Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > how to glob with international or unicode file names?

Reply
Thread Tools

how to glob with international or unicode file names?

 
 
SpringFlowers AutumnMoon
Guest
Posts: n/a
 
      10-14-2007
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
--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
 
 
 
7stud --
Guest
Posts: n/a
 
      10-14-2007
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
...
...
--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
 
 
 
7stud --
Guest
Posts: n/a
 
      10-14-2007
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.
--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
glob.glob unicode bug or feature Elbert Lev Python 5 08-02-2004 12:09 AM
RE: Bug in glob.glob for files w/o extentions in Windows Tim Peters Python 1 12-01-2003 09:22 AM
Bug in glob.glob for files w/o extentions in Windows Georgy Pruss Python 15 12-01-2003 04:04 AM
variable file glob into grep without glob() qanda Perl Misc 1 09-15-2003 08:27 AM



Advertisments