in reply to evaling unicode perl source

If you are running NT/2000, there is a Win32 API that will do that. It's not present in Win9x, though, and it has problems with its handling of illegal codes, so I have my own C++ function UCS2_to_UTF8 written in assembly language.

UTF-8 is Perl's native mode. Use "use utf8" before the RE is parsed, and it will work just fine.

—John
The Win32 Saint

Replies are listed 'Best First'.
Re: Re: evaling unicode perl source
by mamut (Sexton) on Oct 09, 2001 at 18:03 UTC
    -=- MamuT -=-

    Is it same on Unix like solaris, Linux ???

      Is "it" the same? If you mean will Perl swollow UTF-8 and handle UTF-8 sequences as single characters in RE's, then yes.

      Is there a function in the OS to convert USC-2 or UTF-16 into UTF-8? I don't know.

      Will my function work? Only on x86 machines.

      However, the reference implementation in the Unicode book is written in portable C and runs on anything.

      —John