Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/langa/utilities.rb
Overview
Extend class Array and class String to uniformly handle code conversion
to and from unicode
Instance Method Summary collapse
-
#to_unicode ⇒ Object
Converts a string to an array of unicode values.
Instance Method Details
#to_unicode ⇒ Object
Converts a string to an array of unicode values.
'äöü'.to_unicode => [228, 246, 252]
'äöü' as UTF-8 is equivalent to [195, 164, 195, 182, 195, 188]
37 38 39 |
# File 'lib/langa/utilities.rb', line 37 def to_unicode self.unpack('U*') end |