From: "Berger, Daniel" Date: 2003-08-05T05:49:36+09:00 Subject: Re: [BUG?] UTF8 ruby and win32 dir Does it help if you run with -K? (aka $-K) Dan > -----Original Message----- > From: Pierre Baillet [mailto:oct@zoy.org] > Sent: Monday, August 04, 2003 2:41 PM > To: ruby-talk@ruby-lang.org > Subject: [BUG?] UTF8 ruby and win32 dir > > > Hi, > > not sure at all about this one, but on my windows XP pro French, > > doing a Dir.entries.each on a folder with accented letter > doesn't gives UTF-8 back but rather the local encoding for my > filesystem : > > in a folder containing the sub-folders: > t�t� > �f�l > > this script: > file = File.open("ouput.txt","w").binmode > Dir.new("d:/test_accent").each{ |dir| > file.puts dir > } > > spits out a latin1 file (windows-1252, i guess) and not a > unicode one when run using ruby -KU. > > I would have expected ruby to give back UTF8 values when > using the standard library. > > Should I convert the latin1 to UTF-8 by myself ? > Thanks a lot, > -- > Pierre Baillet > Ruby: happy 1.8.0! >