From: Daniel DeLorme Date: 2006-07-10T22:29:04+09:00 Subject: Re: Iconv and incompatible encodings Paul Battley wrote: > Yes, there is. Add //IGNORE to the destination encoding to ignore > unavailable characters, or //TRANSLIT to transliterate them into > combinations of ASCII characters (e.g. `e for 竪). > > E.g.: > > #!/usr/bin/env rubby > $KCODE = 'u' > require 'iconv' > > s = 'caff竪' > > ic_ignore = Iconv.new('US-ASCII//IGNORE', 'UTF-8') > puts ic_ignore.iconv(s) # => caff > > ic_translit = Iconv.new('US-ASCII//TRANSLIT', 'UTF-8') > puts ic_translit.iconv(s) # => caff`e > > //TRANSLIT will raise an exception on characters it can't > transliterate, however; this can be solved by using > '//IGNORE//TRANSLIT' together (in that order). Can anyone else get this to work? Instead of "caff`e" I just get "caff?" Daniel