From: Jimmy Kofler Date: 2007-09-04T03:29:29+09:00 Subject: Re: Inconsistent results using Iconv > RSL ___ wrote: > I just realized that I didn't really ask a question there, did I? > Woops. I'd like to know what I'm doing wrong or perhaps just how to do > it right so that I get the same results. Do I need to manually include > another library that somehow isn't getting included in the other ways > I've tried? I'd really like to be able to count on my Iconv.iconv code > doing what I need all the time but it seems I can't at the moment. :( > > Here's hoping someone can help me solve this puzzle. > > RSL Converting from utf-8 to iso-8859-1 seems to work though (source code file is encoded in UTF-8 and character set encoding of Terminal.app is set to ISO Latin 1, i.e. iso-8859-1). ... p "#{word} => #{Iconv.iconv('iso-8859-1//translit', 'utf-8', word)}" ... => irb(main):020:0> load "omg.rb" "\303\246gis => \346gis" "stra\303\237e => stra\337e" "kierkeg\303\245rd => kierkeg\345rd" "jo\303\243o => jo\343o" "bj\303\270rk => bj\370rk" => true Cheers j.k. -- Posted via http://www.ruby-forum.com/.