* Mark J. Reed <markjreed / mail.com> [Aug, 13 2003 03:10]: > > Right. In a UTF-8 file, the string "hispañïla" doesn't > contain the byte \xf1. It contains the UTF-8 encoding of the character > U+00F1, which is \xc3 \xb1. Ruby can examine the language settings of its > runtime environment, but has no way of doing so for the environment > in which the script was written. So it has no way of knowing what > character encoding a program file itself uses. The -Ku option tells Ruby > that the program file is written in UTF-8. > OK. Thanks for the explanation. Now to the real issue: What I wan't to be able to do is input.tr!("\xf1", "n") where input contains unicode characters. This doesn't seem to be possible. String is only for ISO-8859-1 strings? I feel I'm being stupid here, but sadly I don't know enough about UNICODE to be smart about it (I hope that makes sense ;-). I guess I need to be tr'ing for \xc3\xb1 but that won't be possible. nikolai -- ::: name: Nikolai Weibull :: aliases: pcp / lone-star ::: ::: born: Chicago, IL USA :: loc atm: Gothenburg, Sweden ::: ::: page: www.pcppopper.org :: fun atm: gf,lps,ruby,php,war3 ::: main(){printf(&linux["\021%six\012\0"],(linux)["have"]+"fun"-97);}