# International language encoding conversion

**URL:** <https://www.ruby-forum.com/t/international-language-encoding-conversion/153305>\
**Category:** Ruby\
**Created:** [November 14, 2008, 5:10pm UTC](https://www.ruby-forum.com/t/international-language-encoding-conversion/153305 "2008-11-14T17:10:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![newbie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/dc4da7/32.png) [@newbie](https://www.ruby-forum.com/u/newbie)\
**Post date:** [November 14, 2008, 5:10pm UTC](https://www.ruby-forum.com/t/international-language-encoding-conversion/153305/1 "2008-11-14T17:10:51Z")

</div>

Now that Ruby 1.9.1 supports utf-8, it will be great to play with some  
international languages in Ruby. But I have a question about encoding  
other than utf-8. As for Chinese, some people still use gb2312 or big5  
encodings. How can I make Ruby 1.9.1 recognize them, or even  
automatically convert them to utf-8, if possible? Thanks a lot!

---

<div class="post-metadata">

**Author:** ![newbie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/dc4da7/32.png) [@newbie](https://www.ruby-forum.com/u/newbie)\
**Post date:** [November 15, 2008, 2:33pm UTC](https://www.ruby-forum.com/t/international-language-encoding-conversion/153305/2 "2008-11-15T14:33:36Z")

</div>

Hi,

In message “Re: International language encoding conversion”  
on Sat, 15 Nov 2008 01:07:03 +0900, newbie [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
writes:

|Now that Ruby 1.9.1 supports utf-8, it will be great to play with some  
|international languages in Ruby. But I have a question about encoding  
|other than utf-8. As for Chinese, some people still use gb2312 or big5  
|encodings. How can I make Ruby 1.9.1 recognize them, or even  
|automatically convert them to utf-8, if possible? Thanks a lot!

Ruby 1.9.1 can handle GB2312 and Big5 encoding directly (a la Ruby 1.8  
does for Japanese encoding). But encode method does not understand  
Chinese encoding yet. So, you have to use iconv to translate them  
to/from UTF-8, then force\_encoding. We welcome if someone willing to  
add Big5/GB1312/GB18030 transcoding support.

```
          matz.

```
