tsvik_t has asked for the wisdom of the Perl Monks concerning the following question:

Hi, I need to convert UTF-8 into ISO-8859-8, can you please give me a simple exsample for this thanke Tsvi.

Replies are listed 'Best First'.
Re: converting character types
by Abigail-II (Bishop) on Jul 22, 2002 at 16:43 UTC
    Well, UTF-8 is an encoding for Unicode code points. There are thousands and thousands of Unicode code points defined. In Perl, there's room for 2**48 code points. ISO-8859-8 only has 256 code points. You have a potential problem here.

    However, you may want to look at the Encode modules that come with perl 5.8.0.

    Abigail

      2**48? Just curious as to the rationale for this. I thought Unicode supported only about 1.1 million code points (0-0x10FFFF) and ISO 10646, 2**32 (or maybe it was 2**31) code points. Is there another charset/encoding standard that requires more, is this a consequence of something internal to Perl, or am I misinformed?
        It's just a natural extension - a UTF-8 character can take up to 6 bytes. It isn't quite 2**48 of course, as some bitpatterns are illegal, but it's in this ball park.

        Abigail