UTF-8 strings (was Re: prob)

harper wrote:

say i have a string and want to display only the first 10 characters or
so:

shortstring = "this is a very long string object"[0..10]
# shortstring = "this is a " # which is great

but if i use the same method on a utf8 string, i get some weird
characters popping in there, sometimes yes, sometimes no.

Neither Ruby nor Rails natively supports UTF-8. The built-in string
functions are assuming single-byte characters, which is why it's
returning weird results for the double-byte characters in your UTF-8
string.

This page on the wiki may help:

http://wiki.rubyonrails.org/rails/pages/HowToUseUnicodeStrings

Chris