Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/nwrfc/nwrfclib.rb,
lib/nwrfc/nwrfclib.rb
Instance Method Summary collapse
-
#cU ⇒ Object
Convert string from UTF-8 to doudble-null terminated UTF-16LE string.
-
#uC ⇒ Object
Convert string from UTF-16LE to UTF-8 and trim trailing whitespace.
Instance Method Details
#cU ⇒ Object
Convert string from UTF-8 to doudble-null terminated UTF-16LE string
63 64 65 |
# File 'lib/nwrfc/nwrfclib.rb', line 63 def cU (self.to_s + "\0").force_encoding('UTF-8').encode('UTF-16LE') end |
#uC ⇒ Object
Convert string from UTF-16LE to UTF-8 and trim trailing whitespace
68 69 70 |
# File 'lib/nwrfc/nwrfclib.rb', line 68 def uC self.force_encoding('UTF-16LE').encode('UTF-8').strip end |