gildir has asked for the wisdom of the Perl Monks concerning the following question:
I want to write a simple emebeded perl processor. No problem here. I'll write a pattern, separate perl code from the rest and use an eval() call on it. And now the problem: the file I evaluate is encoded in unicode. Eighter utf8 or utf16.
How do I evaluate UTF16 perl source? In 'normal' case "print 'foo'" will be encoded as "\0p\0r\0i\0n\0t\0 \0'\0f\0o\0o\0'" and that wont eval because every "\0" character will effectively end a string. Another problem is how to run a pattern on a utf8/16 string.
Recoding the source to any 8-bit charset prior to evaling will not work. Some national characters could be lost during this conversion.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: evaling unicode perl source
by John M. Dlugosz (Monsignor) on Oct 08, 2001 at 20:20 UTC | |
by mamut (Sexton) on Oct 09, 2001 at 18:03 UTC | |
by John M. Dlugosz (Monsignor) on Oct 09, 2001 at 19:44 UTC |