how to glob with international or unicode file names?

  • Thread starter SpringFlowers AutumnMoon
  • Start date
S

SpringFlowers AutumnMoon

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
 
7

7stud --

SpringFlowers said:
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
...
...
 
7

7stud --

Hmmm...let's try that again:
SpringFlowers said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top