From: "obdulio santana" <[EMAIL PROTECTED]>
> 2008/3/12, Jenda Krynicky <[EMAIL PROTECTED]>:
> >
> > From: "obdulio santana" <[EMAIL PROTECTED]>
> > > I want to show some áéíóú or ~n ~N in my program but I dont know how to
> > print
> >
> > > it  in a properly way;
> > >
> > > perl -e "print \"algodón\n\""
> > >
> >
> > > algod 3/4 n
> > >
> > > thanks in advance.
> >
> > I'm afraid you'll have to tell us what operating system you use.
> >
> > The problem is most likely that you have your locale or system
> > character encoding or whatever it's called in your OS set up wrong.
> >
> > You should have no problem with Spanish on a properly set system.
> >
> > Sorry
>
> to be more specific  I'm using windows XP, (that why \") and ActivePerl
> 5.8.8 my app must run in console.
>
> the solution about binmode recently propoused didn't fix the problem.
>
> in linux my app work great, but  the end users use windows.
>
> regards, any help will be fantastic ,

I see. Sorry. Properly set is not enough when it comes to Windows. MS
Windblows uses two encodings. For reasons I would love to have a word
about with the culpables (whips and other toys at hand) Windblows
uses one encoding (1252 for western europe&americas, 1250 for central
europe) in the windowed stuff and another (437 or 852 (I think)) for
the Command Prompt. So if you print without changes any characters
that are on different places between the two encodings of your system
(see
HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\NLS\\CodePage,
 the ACP and OEMCP values) you get nonsense.

#!perl
use Encode;

binmode(STDOUT, 'encoding(cp437)');
print  qq{algodón};
__END__

seems to work.

perl -e "use Encode; binmode(STDOUT, 'encoding(cp437)');print
qq{algodón}"

as well.

Jenda
===== [EMAIL PROTECTED] === http://Jenda.Krynicky.cz =====
When it comes to wine, women and song, wizards are allowed
to get drunk and croon as much as they like.
        -- Terry Pratchett in Sourcery


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to