Hi, as known that the default encoding is set to ANSI when creating a
text file. How can I specify the encoding type to UTF-8 other than ANSI
when creating a text file in RUBY? Thanks a lot.
I've tried the ways found by google, but no available. E.g.
tst = File.new("abc.txt","w:UTF-8")
There is an error message: illegal access mode w:UTF-8 (ArgumentError)
Please help me if there is another way to work it out, thanks.
Hi, as known that the default encoding is set to ANSI when creating a
text file. How can I specify the encoding type to UTF-8 other than ANSI
when creating a text file in RUBY? Thanks a lot.
I've tried the ways found by google, but no available. E.g.
tst = File.new("abc.txt","w:UTF-8")
There is an error message: illegal access mode w:UTF-8 (ArgumentError)
========================================
ruby 1.8.7 (2008-08-11 patchlevel 72) [i386-cygwin]
-e:1: warning: encoding options not supported in 1.8: w:UTF-8