# Can Ruby 1.9.1 filenames with unicode characters on Windows?

**URL:** <https://www.ruby-forum.com/t/can-ruby-1-9-1-filenames-with-unicode-characters-on-windows/190762>\
**Category:** Ruby\
**Created:** [June 27, 2010, 4:29am UTC](https://www.ruby-forum.com/t/can-ruby-1-9-1-filenames-with-unicode-characters-on-windows/190762 "2010-06-27T04:29:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![winterheat](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/7993a0/32.png) [@winterheat](https://www.ruby-forum.com/u/winterheat)\
**Post date:** [June 27, 2010, 4:29am UTC](https://www.ruby-forum.com/t/can-ruby-1-9-1-filenames-with-unicode-characters-on-windows/190762/1 "2010-06-27T04:29:39Z")

</div>

Can Ruby 1.9.1 finally get a list of filenames if the filenames have  
unicode characters on Windows?

I think back in the Ruby 1.8.6 and 1.8.7 days, that wasn’t possible on  
Windows.

---

<div class="post-metadata">

**Author:** ![winterheat](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/7993a0/32.png) [@winterheat](https://www.ruby-forum.com/u/winterheat)\
**Post date:** [June 27, 2010, 11:33am UTC](https://www.ruby-forum.com/t/can-ruby-1-9-1-filenames-with-unicode-characters-on-windows/190762/2 "2010-06-27T11:33:19Z")

</div>

Jian L. wrote:

> Can Ruby 1.9.1 finally get a list of filenames if the filenames have  
> unicode characters on Windows?

1.9.1 can’t, but 1.9.2 is much improved.

The situation is covered in some detail here:

[http://redmine.ruby-lang.org/issues/show/1685](http://redmine.ruby-lang.org/issues/show/1685)

But essentially:

utf8\_result = Dir.entries(path, :encoding =\> “UTF-8”)

Regards,

Bill

---

<div class="post-metadata">

**Author:** ![winterheat](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/7993a0/32.png) [@winterheat](https://www.ruby-forum.com/u/winterheat)\
**Post date:** [June 27, 2010, 2:28pm UTC](https://www.ruby-forum.com/t/can-ruby-1-9-1-filenames-with-unicode-characters-on-windows/190762/3 "2010-06-27T14:28:37Z")

</div>

Bill K. wrote:

> Jian L. wrote:
> 
> > Can Ruby 1.9.1 finally get a list of filenames if the filenames have  
> > unicode characters on Windows?
> 
> 1.9.1 can’t, but 1.9.2 is much improved.
> 
> The situation is covered in some detail here:
> 
> [http://redmine.ruby-lang.org/issues/show/1685](http://redmine.ruby-lang.org/issues/show/1685)
> 
> But essentially:
> 
> utf8\_result = Dir.entries(path, :encoding =\> “UTF-8”)
> 
> Regards,
> 
> Bill

thanks. true that on Mac OS X and Linux, it has long been possible?

i know somebody was using `cmd /U /C dir /B` to simulate it on  
Windows… but Ruby 1.8.7 behaves better with it. Ruby 1.9.1 changes  
0x0a to 0x0d and messed up the UTF-16
