how to glob with international or unicode file names?

Discussion in 'Ruby' started by SpringFlowers AutumnMoon, Oct 14, 2007.

  1. SpringFlowers AutumnMoon, Oct 14, 2007
    #1
    1. Advertising

  2. SpringFlowers AutumnMoon

    7stud -- Guest

    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/.
    7stud --, Oct 14, 2007
    #2
    1. Advertising

  3. SpringFlowers AutumnMoon

    7stud -- Guest

    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/.
    7stud --, Oct 14, 2007
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Georgy Pruss
    Replies:
    15
    Views:
    712
    Tim Roberts
    Dec 1, 2003
  2. Tim Peters
    Replies:
    1
    Views:
    348
    Duncan Booth
    Dec 1, 2003
  3. Sean Berry

    Question about glob.glob <--newbie

    Sean Berry, May 4, 2004, in forum: Python
    Replies:
    3
    Views:
    340
    David M. Cooke
    May 4, 2004
  4. Elbert Lev

    glob.glob unicode bug or feature

    Elbert Lev, Jul 31, 2004, in forum: Python
    Replies:
    5
    Views:
    382
    Neil Hodgson
    Aug 2, 2004
  5. qanda
    Replies:
    1
    Views:
    107
    Tassilo v. Parseval
    Sep 15, 2003
Loading...

Share This Page