A small internationalization issue?

Discussion in 'Ruby' started by tuti plain, Jan 3, 2010.

  1. tuti plain

    tuti plain Guest

    Hi all,

    I am a Puerto Rican using Ruby, so the apps I develop are mostly in
    Spanish. I am using FXRuby for GUI development (I want to learn wxRuby,
    but I can't find any good tutorials out there). Sometimes, when I
    create FXLabels, and have to use Spanish characters like: á é í ó ú,
    they don't display properly on the window. I did a simple test and made
    a script with one single line:

    puts "á é í ó ú"

    When I run this script, the output is:

    ß Θ φ ≤ ·

    Obviously not what I intended! Funny thing is, when I write that very
    same line using irb, the characters display properly.

    I think there might be some sort of internationalization issue, perhaps
    not even in the language itself.

    This is a problem because these characters are sometimes necessary for
    words in Spanish, and not using them might mean grammatically incorrect
    applications.

    Can someone please clarify this for me? Thanks!
    --
    Posted via http://www.ruby-forum.com/.
    tuti plain, Jan 3, 2010
    #1
    1. Advertising

  2. On Sun, Jan 3, 2010 at 1:40 PM, tuti plain <> wrote:

    > puts "=C3=A1 =C3=A9 =C3=AD =C3=B3 =C3=BA"
    >
    > When I run this script, the output is:
    >
    > =C3=9F =CE=98 =CF=86 =E2=89=A4 =C2=B7


    > Can someone please clarify this for me? =C2=A0Thanks!


    What version of Ruby are you running? What encoding are your files
    saved in? We will need to know this in order to be able to help out.

    If you're new to character encodings, in general or just in Ruby, this
    series might help:
    http://blog.grayproductions.net/categories/character_encodings

    -greg
    Gregory Brown, Jan 3, 2010
    #2
    1. Advertising

  3. tuti plain

    tuti plain Guest

    Hi, I am using Ruby 1.8.6, the One Click Installer version, running on
    windows 7. I use the scite text editor included with that ruby
    distribution. Since I haven't tampered with the text editor's encoding
    settings, my files are saved in the default, which seems to be "Code
    Page Property".

    As a simple test, I changed the encoding to UTF-8 and saved the file.
    Now, the editor line looks like this:

    puts "E1 E9 ED F3 FA"

    But the output is still wrong.




    > What version of Ruby are you running? What encoding are your files
    > saved in? We will need to know this in order to be able to help out.
    >
    > If you're new to character encodings, in general or just in Ruby, this
    > series might help:
    > http://blog.grayproductions.net/categories/character_encodings
    >
    > -greg


    --
    Posted via http://www.ruby-forum.com/.
    tuti plain, Jan 4, 2010
    #3
  4. On Sun, Jan 3, 2010 at 8:07 PM, tuti plain <> wrote:

    > puts "E1 E9 ED F3 FA"
    >
    > But the output is still wrong.


    If you're using Ruby 1.8.6, be sure to set $KCODE="U"

    -greg
    Gregory Brown, Jan 4, 2010
    #4
  5. tuti plain

    tuti plain Guest

    > If you're using Ruby 1.8.6, be sure to set $KCODE="U"

    Hi thanks for your reply. Sorry I took so long to reply. I tried what
    you said, but it didn't work either. I still see incorrect characters.
    What else can I try?
    --
    Posted via http://www.ruby-forum.com/.
    tuti plain, Jan 11, 2010
    #5
  6. On Mon, Jan 11, 2010 at 7:44 AM, tuti plain <> wrote:
    >> If you're using Ruby 1.8.6, be sure to set $KCODE=3D"U"

    >
    > Hi thanks for your reply. =A0Sorry I took so long to reply. =A0I tried wh=

    at
    > you said, but it didn't work either. =A0I still see incorrect characters.
    > What else can I try?


    It's possible that you're using a terminal that doesn't play nice with
    UTF-8 characters. Check your terminal settings.

    -greg
    Gregory Brown, Jan 11, 2010
    #6
    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. Pablo Jose Almeida da Guia

    Internationalization Problem

    Pablo Jose Almeida da Guia, Dec 5, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    375
    Pablo Jose Almeida da Guia
    Dec 5, 2003
  2. Natty Gur

    Re: internationalization problem

    Natty Gur, Dec 23, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    412
    Francois Malgreve
    Dec 23, 2003
  3. Francois Malgreve

    internationalization problem continues.

    Francois Malgreve, Dec 29, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    311
    Francois Malgreve
    Dec 29, 2003
  4. =?Utf-8?B?UGl5dXNoIEdvdmls?=

    internationalization of Apps ????

    =?Utf-8?B?UGl5dXNoIEdvdmls?=, Jun 2, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    358
    =?Utf-8?B?UGl5dXNoIEdvdmls?=
    Jun 2, 2004
  5. Jules
    Replies:
    3
    Views:
    492
Loading...

Share This Page