[Israel.pm] Hebrew strings in perl

Shmuel Fomberg shmuelfomberg at gmail.com
Wed Nov 28 04:39:12 PST 2012


On Wed, Nov 28, 2012 at 9:05 PM, Dov Levenglick wrote:

> I haven't tried printing Hebrew strings in Perl yet, I seem to recall a
> talk last YAPC and only having to add use utf8;
>
> use utf8;
> print "דוב";
>
> why does this produce the following:
> Wide character in print at Desktop\test.pl line 2.
> דוב
>

Perl is pushing unicode into th concole. (and that is why it warns)
however, on Windows, the default concole box does not know how to handle
unicode.
So you either need to install a dos box that do know how to display
unicode, or figure out which encoding your concole is displaying and encode
the text to that before printing.
(or just push a layer to stdout using binmode)

Shmuel.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.perl.org.il/pipermail/perl/attachments/20121128/a6db20f1/attachment.htm 


More information about the Perl mailing list