Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/nwrfc/nwrfclib.rb

Overview

Enhancement to the String class to put string values into double-null terminated UTF16 little endian encoded strings as required by the NW RFC SDK function, which should work on Linux and Windows (and maybe other architectures, though the plan is not to support them) String.class_evalIconv.conv(“UTF-16LE”, “UTF8”, self+“0”) }

Instance Method Summary collapse

Instance Method Details

#cUObject

Convert string from UTF-8 to doudble-null terminated UTF-16LE string



56
57
58
# File 'lib/nwrfc/nwrfclib.rb', line 56

def cU
  NWRFCLib::Cutf8_to_utf16le.iconv(self+"\0")
end

#uCObject

Convert string from UTF-16LE to UTF-8 and trim trailing whitespace



61
62
63
# File 'lib/nwrfc/nwrfclib.rb', line 61

def uC
  NWRFCLib::Cutf16le_to_utf8.iconv(self).strip
end