I can't print spanish characters on console

E

_ex_

I'm trying to use to output spanish characters on the console, I'm
using a WinXP system and I know cmd can print acute vocals or the
ñ/Ñ. But the print command is showing another characters. Is there a
simple way to do this?
Thanks in advance.

Note: Win32::Console::OutputCP(437) is not working or I'm doing
something wrong.
 
E

_ex_

After a little more search I found my answer:

Windows uses code page 1252, but console uses code page 850 so if you
want to print some charcater > 127 on console you do:

print encode("cp850", "Núñez\n");
 
W

Winston

_ex_ escribió:
After a little more search I found my answer:

Windows uses code page 1252, but console uses code page 850 so if you
want to print some charcater > 127 on console you do:

print encode("cp850", "Núñez\n");

I ve tried it, but look the mesage:

"Undefined subroutine &main::encode called at example.pl line 68,
<STDIN> line 5.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,265
Latest member
TodLarocca

Latest Threads

Top