Unicode “support”

By squarewheel

Just a simple console session:

>> "Zażółć"[0,3]
=> "Za\305"
>> "Zażółć"[0,4]
=> "Zaż"
>> "Zażółć".length
=> 10

OK, it quite works with Chars class:

>> "Zażółć".chars[0,3].to_s
=> "Zaż"
>> "Zażółć".chars[0,4].to_s
=> "Zażó"
>> "Zażółć".chars.length
=> 6

Not the most elegant solution, but works.

Leave a Reply