Support for Unicode strings

R

RHaus

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

Austin Ziegler

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 =3D '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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top