From: A LeDonne Date: 2006-01-13T01:31:10+09:00 Subject: Re: Dir.entires and UTF-8 On 1/12/06, Yukihiro Matsumoto wrote: > Hi, > > On 1/13/06, Timo Hoepfner wrote: > > > What's going on here? Ths is on MacOS X 10.4.4. Looks like > > Dir#entries returns strings encoded with some encoding I didn't > > expect. How can I convert the string to UTF8? > > You have got a corrent UTF-8 string. Unlike Windows XP, Mac OS X > decomposes character components as much as possible (Sorry I forgot > the correct term for this policy). So what you got: > > > # => ["a", "", "o", "", "u", "", "�", "A", "", "O", "", "U", ""] > > is decomposed form of your string, a+umlaut, o+umlaut, etc. > > matz. > Matz refers to Unicode Normalization Form D (NFD). According to http://developer.apple.com/technotes/tn/tn1150.html (HFS Plus Volume Format): "HFS Plus stores strings fully decomposed and in canonical order. HFS Plus compares strings in a case-insensitive fashion. Strings may contain Unicode characters that must be ignored by this comparison. For more details on these subtleties, see Unicode Subtleties." -A