# UTF8 name not carried into the page cache filename

**URL:** <https://www.ruby-forum.com/t/utf8-name-not-carried-into-the-page-cache-filename/189284>\
**Category:** Rails\
**Created:** [May 28, 2010, 1:39am UTC](https://www.ruby-forum.com/t/utf8-name-not-carried-into-the-page-cache-filename/189284 "2010-05-28T01:39:22Z")\
**Posts on this page:** 2\
**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 28, 2010, 1:39am UTC](https://www.ruby-forum.com/t/utf8-name-not-carried-into-the-page-cache-filename/189284/1 "2010-05-28T01:39:22Z")

</div>

I am using ruby 1.8.7 and rail 3 beta3 on Windows XP.

Page caching works okay and the content of the cache is UTF8 as  
expected. However, the filename which came from the UTF8 URL is not  
okay.

Apache can not find the file because it is not filed as a UTF8  
filename but something else.

I do not know whether this is a Rails 3 bug or something I did wrong.  
Can anybody help?

---

<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, 3:36am UTC](https://www.ruby-forum.com/t/utf8-name-not-carried-into-the-page-cache-filename/189284/2 "2010-05-30T03:36:03Z")

</div>

I have concluded that the problem is not Rails or Rails3. I have come  
to believe it is a Ruby problem. I have sent the comments below to a  
ruby forum.

* * *

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