Windows command & unicode

Discussion in 'Ruby' started by m44rt3n@yahoo.com, Nov 15, 2006.

  1. Guest

    Hi all,

    I have a problem using unicode characters in the windows command.

    As a very simple example, when I type this:

    H:\>ruby -e 'puts "rien à faire"'

    I will get the following:

    rien Ó faire

    Does anyone know what causes this?
    When I run my scripts from Scite, this problem doesn't come up.

    Kind regards,
    Maarten
    , Nov 15, 2006
    #1
    1. Advertising

  2. Re: Windows command & unicod

    On 11/15/06, <> wrote:
    > Hi all,
    >
    > I have a problem using unicode characters in the windows command.
    >
    > As a very simple example, when I type this:
    >
    > H:\>ruby -e 'puts "rien =E0 faire"'
    >
    > I will get the following:
    >
    > rien =D3 faire
    >
    > Does anyone know what causes this?
    > When I run my scripts from Scite, this problem doesn't come up.
    >


    I believe the Windows command prompt displays text using the system
    codepage (the Regional Settings control panel). I'm not aware of a way
    to make it treat things as real UTF-8.

    Let me know if you figure it out, though. Heh.
    Wilson Bilkovich, Nov 15, 2006
    #2
    1. Advertising

  3. Re: Windows command & unicod

    On 11/15/06, <> wrote:
    > Hi all,
    >
    > I have a problem using unicode characters in the windows command.
    >
    > As a very simple example, when I type this:
    >
    > H:\>ruby -e 'puts "rien =E0 faire"'
    >
    > I will get the following:
    >
    > rien =D3 faire
    >
    > Does anyone know what causes this?
    > When I run my scripts from Scite, this problem doesn't come up.


    Please search the archives. There was a discussion about the
    limitations of cmd.exe and Unicode. What you want generally can't be
    done from the command-line in Windows.

    -austin
    --=20
    Austin Ziegler * * http://www.halostatue.ca/
    * * http://www.halostatue.ca/feed/
    *
    Austin Ziegler, Nov 15, 2006
    #3
  4. Guest

    Re: Windows command & unicod

    On Nov 15, 5:48 pm, "Austin Ziegler" <> wrote:
    > On 11/15/06, <> wrote:
    >
    > > Hi all,

    >
    > > I have a problem usingunicodecharacters in the windows command.

    >
    > > As a very simple example, when I type this:

    >
    > > H:\>ruby -e 'puts "rien à faire"'

    >
    > > I will get the following:

    >
    > > rien Ó faire

    >
    > > Does anyone know what causes this?
    > > When I run my scripts from Scite, this problem doesn't come up.Please search the archives. There was a discussion about the

    > limitations ofcmd.exeandUnicode. What you want generally can't be
    > done from the command-line in Windows.
    >
    > -austin
    > --
    > Austin Ziegler * *http://www.halostatue.ca/
    > * *http://www.halostatue.ca/feed/
    > *



    Thanks, this got me on my way.

    It seems this works:

    require 'iconv'
    puts Iconv.new("ibm850","iso-8859-1").iconv("rien à faire")
    , Nov 15, 2006
    #4
    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. Robert Mark Bram
    Replies:
    0
    Views:
    3,897
    Robert Mark Bram
    Sep 28, 2003
  2. ygao

    unicode wrap unicode object?

    ygao, Apr 8, 2006, in forum: Python
    Replies:
    6
    Views:
    520
    =?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=
    Apr 8, 2006
  3. Gabriele *darkbard* Farina

    Unicode digit to unicode string

    Gabriele *darkbard* Farina, May 16, 2006, in forum: Python
    Replies:
    2
    Views:
    484
    Gabriele *darkbard* Farina
    May 16, 2006
  4. gabor
    Replies:
    13
    Views:
    524
    Leo Kislov
    Nov 18, 2006
  5. Alf P. Steinbach
    Replies:
    11
    Views:
    2,154
    Alf P. Steinbach
    Nov 23, 2011
Loading...

Share This Page