[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ruby-talk
Subject:    =?ISO-8859-1?Q?Windows_XP_can_create_a_R=E9sum=E9=2Ehtml_file_but_ruby_?=
From:       "Dave.Hurrell () gmail ! com" <dave ! hurrell () gmail ! com>
Date:       2010-05-30 0:31:03
Message-ID: 92a1977c-d97a-4edb-ae18-4e05cfa8c781 () 23g2000pre ! googlegroups ! com
[Download RAW message or body]

Windows XP can create a Résumé.html file but ruby cannot.  Why?

The following code  created the wrong filename
    File.open("Résumé.html","w") { |file| file.write('xxx'); }

Also, this code does not work
    str = "Résumé.html"
    filename = Iconv.conv('UTF-16','UTF-8',str)
    File.open(filename,"w") { |file| file.write('xxx'); }

If I manually rename the file to Résumé.html, it does work.

Setting the $KCODE="u" or $KCODE="UTF8" makes no difference.

Whats wrong with ruby v1.8.7 (or is it me)?


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic