# Support for Unicode strings

**URL:** <https://www.ruby-forum.com/t/support-for-unicode-strings/60962>\
**Category:** Ruby\
**Created:** [January 11, 2006, 2:04pm UTC](https://www.ruby-forum.com/t/support-for-unicode-strings/60962 "2006-01-11T14:04:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rhaus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e68b1a/32.png) [@rhaus](https://www.ruby-forum.com/u/rhaus)\
**Post date:** [January 11, 2006, 2:04pm UTC](https://www.ruby-forum.com/t/support-for-unicode-strings/60962/1 "2006-01-11T14:04:53Z")

</div>

I am rather new to ruby but was considering to use it for my next  
project. However, support for Unicode strings would be essential. This  
includes the correct handling of unicode strings in regular expressions,  
in IO operations etc. How is this best done in Ruby?

---

<div class="post-metadata">

**Author:** ![rhaus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e68b1a/32.png) [@rhaus](https://www.ruby-forum.com/u/rhaus)\
**Post date:** [January 11, 2006, 4:06pm UTC](https://www.ruby-forum.com/t/support-for-unicode-strings/60962/2 "2006-01-11T16:06:45Z")

</div>

On 11/01/06, RHaus [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I am rather new to ruby but was considering to use it for my next  
> project. However, support for Unicode strings would be essential. This  
> includes the correct handling of unicode strings in regular expressions,  
> in IO operations etc. How is this best done in Ruby?

Please do a search on this. The answers to these questions have been  
given a dozen times. A quick summary:

1. Ruby Strings are byte vectors. Eith $KCODE = ‘u’, you get some  
additional capabilities with Regexen for Unicode (UTF-8).
2. As long as you’re not actually looking for foo[0] to give you the  
first character (Unicode or otherwise), you’ll be okay.

Ruby does just fine with most applications of Unicode. Ruby 2.0 will  
include m17n Strings that will make it even better, not just for  
Unicode.

-austin
