From: "NARUSE, Yui" Date: 2012-11-09T17:56:22+09:00 Subject: [ruby-core:49141] Re: [ruby-trunk - Bug #7267] Dir.glob on Mac OS X returns unexpected string encodings for unicode file names 2012/11/3 meta (mathew murphy) : > Relevant links: > > http://search.cpan.org/~tomita/Encode-UTF8Mac-0.03/lib/Encode/UTF8Mac.pm > > Seems to me Ruby should pick one of the standard normalization forms for all UTF-8 data, and convert when necessary. > > Apparently there are OS X library calls to assist: > http://developer.apple.com/library/mac/qa/qa1235/_index.html Ruby already has UTF8-MAC to UTF-8 converter. You can use it by str.encode("UTF-8", "UTF8-MAC"). -- NARUSE, Yui