[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!

Daniel,

···

On Tue, Aug 05, 2003, Berger, Daniel wrote:

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

spits out a latin1 file (windows-1252, i guess) and not a
unicode one when run using ruby -KU.
^^^^^^^

That what i’m doing.


Pierre Baillet
In the words of the ancients, one should make his decision within the space of
seven breaths. It is a matter of being determined and having the spirit to
break through to the other side.
Ghost Dog - The Way of the Samouraï