From: 7stud -- Date: 2008-03-06T22:32:59+09:00 Subject: Re: Dir#.glob over accentuated named directories ??? Une Bév ue wrote: > over MacOS X the user could have named directories using accentuated > characters like : > > "D�faut" (for Default) > > when doing a Dir.glob over the parent directory of it i get : > > > is there a way to get the "right" name in UTF-8 ??? instead of ASCII ? > Ruby has the "right" name--it's just that your display device is unable to display it. For instance, when I use Dir.glob to read a directory that contains a file named cafe.txt, where the 'e' has an accent, this is the output: /TestData/cafe_\_314_\_201.txt #underscores added by me which is the UFT-8 character : _\_x_cc_\_x_81 #underscores added by me in octal format. You can prove that to yourself by doing this: puts "cafe_\_xcc_\_x81" #remove the underscores When you say I get: > De'faut that is completely meaningless. That is your display device's interpretation of the string. As for what display device you are using and what encodings it can display, e.g. ascii, UTF-8, or even what character your filename actually contains, who knows? The forum software and/or my browser are interpreting your problematic character as a black square with a question mark inside it. -- Posted via http://www.ruby-forum.com/.