Kless
8/28/2008 6:13:00 PM
Thanks! It will help until rb 1.9 been more extended.
On Aug 28, 1:11 pm, James Gray <ja...@grayproductions.net> wrote:
> On Aug 28, 2008, at 3:51 AM, Kless wrote:
>
> > How to decode a String type to Unicode?
>
> $ ruby -KU -e 'p "Résumé".unpack("U*")'
> [82, 233, 115, 117, 109, 233]
>
> > And, to encode Unicode to String?
>
> $ ruby -KU -e 'p [82, 233, 115, 117, 109, 233].pack("U*")'
> "Résumé"
>
> Hope that helps.
>
> James Edward Gray II