From: Marnen Laibow-Koser Date: 2009-12-29T04:22:13+09:00 Subject: Re: ruby 1.9 hates you and me and the encodings we rode in o Benoit Daloze wrote: > 2009/12/27 Brian Candler > >> >> The solution I use is simple: stick to ruby 1.8.x. When that branch >> dies, perhaps reia will be ready. If not I'll move to something else. >> >> IMO, both python 3 and erlang have got the right idea when it comes to >> handling UTF8. >> -- >> Posted via http://www.ruby-forum.com/. >> >> > Hi, > > I got this kind of problem yesterday too. > > While taking some file names with Dir#[], I got some special results. > > I was searching for "bad" file names, I mean file names with é,ê or > whatever. When I print the String given in the block directly, no > problem. > > But then I come with things like: > /Users/benoitdaloze/Library/GlestGame/data/lang/espan>̃ > (The ~ is separated from the n and then is not ñ). The Regexp is acting > like > it is 2 different characters. And so it is. If memory serves, Mac OS X stores filenames in normal form D. > How to handle that easily? Normalize to normal form C instead. Best, -- Marnen Laibow-Koser http://www.marnen.org marnen@marnen.org -- Posted via http://www.ruby-forum.com/.