# A small internationalization issue?

**URL:** <https://www.ruby-forum.com/t/a-small-internationalization-issue/181008>\
**Category:** Ruby\
**Created:** [January 3, 2010, 7:40pm UTC](https://www.ruby-forum.com/t/a-small-internationalization-issue/181008 "2010-01-03T19:40:03Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![tutiplain](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/77aa72/32.png) [@tutiplain](https://www.ruby-forum.com/u/tutiplain)\
**Post date:** [January 3, 2010, 7:40pm UTC](https://www.ruby-forum.com/t/a-small-internationalization-issue/181008/1 "2010-01-03T19:40:03Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![tutiplain](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/77aa72/32.png) [@tutiplain](https://www.ruby-forum.com/u/tutiplain)\
**Post date:** [January 3, 2010, 8:21pm UTC](https://www.ruby-forum.com/t/a-small-internationalization-issue/181008/2 "2010-01-03T20:21:12Z")

</div>

On Sun, Jan 3, 2010 at 1:40 PM, tuti plain [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> puts “Ã¡ Ã© Ã­ Ã³ Ãº”
> 
> When I run this script, the output is:
> 
> ÃŸ Î˜ Ï† â‰¤ Â·

> Can someone please clarify this for me? Â Thanks!

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](http://blog.grayproductions.net/categories/character_encodings)

-greg

---

<div class="post-metadata">

**Author:** ![tutiplain](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/77aa72/32.png) [@tutiplain](https://www.ruby-forum.com/u/tutiplain)\
**Post date:** [January 4, 2010, 2:07am UTC](https://www.ruby-forum.com/t/a-small-internationalization-issue/181008/3 "2010-01-04T02:07:24Z")

</div>

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](http://blog.grayproductions.net/categories/character_encodings)
> 
> -greg

---

<div class="post-metadata">

**Author:** ![tutiplain](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/77aa72/32.png) [@tutiplain](https://www.ruby-forum.com/u/tutiplain)\
**Post date:** [January 4, 2010, 3:09pm UTC](https://www.ruby-forum.com/t/a-small-internationalization-issue/181008/4 "2010-01-04T15:09:09Z")

</div>

On Sun, Jan 3, 2010 at 8:07 PM, tuti plain [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
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

---

<div class="post-metadata">

**Author:** ![tutiplain](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/77aa72/32.png) [@tutiplain](https://www.ruby-forum.com/u/tutiplain)\
**Post date:** [January 11, 2010, 1:44pm UTC](https://www.ruby-forum.com/t/a-small-internationalization-issue/181008/5 "2010-01-11T13:44:38Z")

</div>

> 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?

---

<div class="post-metadata">

**Author:** ![tutiplain](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/77aa72/32.png) [@tutiplain](https://www.ruby-forum.com/u/tutiplain)\
**Post date:** [January 11, 2010, 3:03pm UTC](https://www.ruby-forum.com/t/a-small-internationalization-issue/181008/6 "2010-01-11T15:03:57Z")

</div>

On Mon, Jan 11, 2010 at 7:44 AM, tuti plain [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> > 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?

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

-greg
