in reply to Character Recode Perlcode

The answer is here -> How do I convert a string to Unicode and back (v5.005_03)?. If you do a Super Search for "utf16" in the text you will turn up this link amongst others. Text::Iconv is a modular solution to encoding conversion.

use Text::Iconv; $converter = Text::Iconv->new("fromcode", "tocode"); $converted = $converter->convert("Text to convert");

cheers

tachyon

s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print

Replies are listed 'Best First'.
Re: Re: Character Recode Perlcode
by gildir (Pilgrim) on Oct 03, 2001 at 19:51 UTC
    There is a problem:

    If I recode string "print 'foo'" to UTF16, I will get "\0p\0r\0i\0n\0t\0 \0'\0f\0o\0o\0'" and if I eval that string, I will get nothing, as the first "\0" will effectively ends the string. Similar problem exists with UTF8.

    There is no problem recoding string, egighter Text::Iconv or Unicode::String with Unicode::Map8 can be used, but there is problem evaling UTF8/UTF16 string.