# Windows XP can create a RÃ©sumÃ©.html file but ruby cannot

**URL:** <https://www.ruby-forum.com/t/windows-xp-can-create-a-ra-suma-html-file-but-ruby-cannot/197045>\
**Category:** Ruby\
**Created:** [May 30, 2010, 2:31am UTC](https://www.ruby-forum.com/t/windows-xp-can-create-a-ra-suma-html-file-but-ruby-cannot/197045 "2010-05-30T02:31:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [May 30, 2010, 2:31am UTC](https://www.ruby-forum.com/t/windows-xp-can-create-a-ra-suma-html-file-but-ruby-cannot/197045/1 "2010-05-30T02:31:39Z")

</div>

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)?

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [May 31, 2010, 4:27am UTC](https://www.ruby-forum.com/t/windows-xp-can-create-a-ra-suma-html-file-but-ruby-cannot/197045/2 "2010-05-31T04:27:59Z")

</div>

The following works properly in ruby v1.9.1  
File.open(“RÃ©sumÃ©.html”,“w”) { |file| file.write(‘xxx’); }

However, this does not help me because Rails 3 Beta3 will not work with  
ruby v1.9.1 and Windows XP (Rails3 crashes without an error message on  
the sample).

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [May 31, 2010, 9:19am UTC](https://www.ruby-forum.com/t/windows-xp-can-create-a-ra-suma-html-file-but-ruby-cannot/197045/3 "2010-05-31T09:19:12Z")

</div>

Dave Hurrell wrote:

> The following works properly in ruby v1.9.1  
> File.open(“RÃ©sumÃ©.html”,“w”) { |file| file.write(‘xxx’); }
> 
> However, this does not help me because Rails 3 Beta3 will not work with  
> ruby v1.9.1 and Windows XP (Rails3 crashes without an error message on  
> the sample).

Not even 1.9.1 supports unicode paths on windows very well.

Ruby 1.9.2, which is not officially released yet, has made  
significant improvements in windows unicode path handling.  
It’s not 100% (for example, Dir.pwd has no unicode support  
on windows yet.) But it’s definitely improved from 1.9.1.

Regards,

Bill
