CP1255 is not Unicode; it is an 8-bit codepage. These are remnants from the
old days where memory was scarce and full internationalization was not a
hard requirement. They generally extended ASCII (which uses only 7 bits)
with characters from (generally) only one or two more languages, whatever
fits in the extra 128 points.

I don't know enough about the Windows installations of Perl to say why
you're missing so many encodings. Is this Strawberry Perl?

In a pinch, you can implement your own encoding module (see
Encode::Encoding). The general idea is to pass any ASCII through, deduct
1474 from Hebrew Unicode characters, and die on anything else. (Why 1474?
Because Aleph is U+05d0 and codepage 1255 (almost == iso 8859-8) begins at
0xE0. See Encode::Encoding.

On Mon, Jul 12, 2010 at 11:10 AM, Meir Guttman <[email protected]> wrote:

> Thanks Shmuel!
>
> Isn't Cp1255 Unicode too?
>
> As I said in a previous post of this thread, this is not a pressing issue
> for me right now. So I'll give it a rest now.
>
> (You see, I am spoiled ;-). I am used to get a "quick fix" to most of my
> Perl problems from the community. But I see that this one is not going to
> such. I am rather surprised though. I would expect Microsoft at least to
> support Hebrew and/or Unicode on something so basic as the command window.
> And as to many applications breaking down with BiDi, they can include a
> "compatibility mode", can't they? But its Microsoft, right?)
>
> Regards,
> Meir
>
> -----Original Message-----
> From: [email protected] [mailto:[email protected]] On Behalf
> Of Shmuel Fomberg
> Sent: Sunday, July 11, 2010 10:53 PM
> To: Perl in Israel
> Subject: Re: [Israel.pm] Hebrew in the command window
>
> Hi Meir.
>
> Meir Guttman wrote:
> > The problem I have is when I "print" Hebrew to the STDOUT device. It is
> > shown as "gibberish." (BTW, re-directing it to a file and opening it in
> > a UTF-8 compatible editor shows the Hebrew fine, thank you!)
>
> The DOS box is not unicode-aware. so you need to convert the text to
> hebrew 8-bit encoding before printing it out.
> try to convert it (decode) to "iso-8859-8" or "cp865", or, if these two
> doesn't work, try "cp1255".
>
> Of course, you need to make sure that your terminal is loaded with
> hebrew-capable fonts.
> I would advise to first write a small program that print a nice table,
> with all the characters above 30. you should see hebrew letters in
> there, or you need to change the font.
> In addition, it will give you a clue which code page you need to use.
> Indexed by the 'Alef' position:
> 128 - cp865
> 224 - iso-8859-8
>
> Have fun.
> Shmuel.
>
> _______________________________________________
> Perl mailing list
> [email protected]
> http://mail.perl.org.il/mailman/listinfo/perl
>
> _______________________________________________
> Perl mailing list
> [email protected]
> http://mail.perl.org.il/mailman/listinfo/perl
>



-- 
Gaal Yahas <[email protected]>
http://gaal.livejournal.com/
_______________________________________________
Perl mailing list
[email protected]
http://mail.perl.org.il/mailman/listinfo/perl

Reply via email to