From: Nikolai Weibull Date: 2003-08-13T01:34:41+09:00 Subject: Re: UTF-8 question * Yukihiro Matsumoto [Aug, 12 2003 18:10]: > Hi, > > In message "UTF-8 question" > on 03/08/12, Nikolai Weibull writes: > > |My problem, however, is: Ruby doesn't seem to support UTF-8, which is bad > |for me. I need it to parse incoming UTF-8 strings to convert them to > |valid ISO9660 filenames. Anyone have any suggestions as to how to solve > |this? Are there any good libraries? > > As usual, my first answer is: > > define "UTF-8 support" first. > hm...I messed up. I was trying to do "hispa�ola".gsub(/\xf1/, 'n'), but should have been doing "hispa�ola".gsub(/�/, 'n') > > Ruby does support UTF-8 mostly using its UTF-8 aware regex engine. > Besides, for conversion between encodings, you have iconv module. > Yeah, I found it. Too bad I couldn't find the documentation for it (but I guessed the method names and it works fine ;-) (principle of least surprise at work i guess ;-) thanks, 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);}