in reply to calling the interpreter from a utf8 script


Update You can indeed execute scripts written in Unicode I was incorrect --> I was able to replicate your error on a Windows box if I saved the script in Unicode using Notepad. However, I got the same script to work fine if I saved it as UTF-8. (using Perl v. 5.8).
previous: I don't believe you can encode the script in UTF. You can use Perl to read various UTF Encodings to both decode(read) and encode(when writing) in various UTF formats, but your source still needs to be in ASCII if I read your post correctly.
  • Comment on Re: calling the interpreter from a utf8 script

Replies are listed 'Best First'.
Re: Re: calling the interpreter from a utf8 script
by etcshadow (Priest) on Nov 19, 2003 at 06:07 UTC
    Well "saved in unicode" can mean many different things... utf8 is just one of many encodings in "unicode". There are others. One of the nice things about unicode is that all characters which can be encoded in the old 8-bit reprentation of 7-bit ascii are encoded exactly the same in utf8 (I think that's where the term "utf8" originates from... but I could be wrong).

    Anyways, looking at Textpad, which is the editor I use when on windows: it has several encoding options, among them "ANSI" (which is the closest it has to ASCII), "UTF-8", and "Unicode". Here is how they encode the character string "adsf":

    [me@host]$ hd ~/asdf.unicode 0000000 a nul s nul d nul f nul 61 00 73 00 64 00 66 00 0000010 [me@host]$ hd ~/asdf.utf8 0000000 a s d f 61 73 64 66 0000004 [me@host]$ hd ~/asdf.ascii 0000000 a s d f 61 73 64 66 0000004 [me@host]$
    Get the idea?

    ------------
    :Wq
    Not an editor command: Wq