oscurrency/oscurrency — pull request #141 by 3point2 (2012-01-23 00:45:49+00:00)
Title: fixing slicing of multibyte strings (fixes #23 and #61)

hi Tom,

This should fix the trouble we were having creating exchanges. the slice method was cutting multibyte UTF-8 characters in mid-character, resulting in invalid byte sequences.

an easy way to replicate from the ruby console is to slice a utf-8 string like "τεστ" an an odd number, e.g.

"τεστ".slice(0,3)

i fixed it using this: http://api.rubyonrails.org/classes/ActiveSupport/Multibyte/Chars.html