# How to glob with international or unicode file names?

**URL:** <https://www.ruby-forum.com/t/how-to-glob-with-international-or-unicode-file-names/117179>\
**Category:** Ruby\
**Created:** [October 14, 2007, 1:16pm UTC](https://www.ruby-forum.com/t/how-to-glob-with-international-or-unicode-file-names/117179 "2007-10-14T13:16:14Z")\
**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:** [October 14, 2007, 1:16pm UTC](https://www.ruby-forum.com/t/how-to-glob-with-international-or-unicode-file-names/117179/1 "2007-10-14T13:16:14Z")

</div>

with the Dir[" path "]  
or Dir.glob

is it possible to glob the filenames with unicode or international  
characters in it? Right now it is returning ???.mp3

to test it, you can grab some international characters at

[http://news.google.com/news?ned=hk](http://news.google.com/news?ned=hk)

---

<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:** [October 14, 2007, 7:45pm UTC](https://www.ruby-forum.com/t/how-to-glob-with-international-or-unicode-file-names/117179/2 "2007-10-14T19:45:21Z")

</div>

SpringFlowers AutumnMoon wrote:

> with the Dir[" path "]  
> or Dir.glob
> 
> is it possible to glob the filenames with unicode or international  
> characters in it? Right now it is returning ???.mp3

I think that means your display device doesn’t understand the  
characters–not that ruby is unable to retrieve those filenames. For  
instance, if I have a file named:

ááá.txt

in the current directory, and I write:

arr = Dir[’\*’]  
puts arr

I get:

…  
…  
ááá.txt  
…  
…

---

<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:** [October 14, 2007, 7:55pm UTC](https://www.ruby-forum.com/t/how-to-glob-with-international-or-unicode-file-names/117179/3 "2007-10-14T19:55:30Z")

</div>

Hmmm…let’s try that again:

7stud – wrote:

> SpringFlowers AutumnMoon wrote:
> 
> > with the Dir[" path "]  
> > or Dir.glob
> > 
> > is it possible to glob the filenames with unicode or international  
> > characters in it? Right now it is returning ???.mp3
> 
> I think that means your display device doesn’t understand the  
> characters–not that ruby is unable to retrieve those filenames. For  
> instance, if I have a file named:

Ã¡Ã¡Ã¡.txt

in the current directory, and I write:

arr = Dir[’\*’]  
puts arr

the output is:

…  
…  
Ã¡Ã¡Ã¡.txt  
…  
…

My terminal can display utf-8 encoded characters.
