Class: EncodedString

Inherits:
BinData::Primitive
  • Object
show all
Defined in:
lib/bindata/itypes.rb

Instance Method Summary collapse

Instance Method Details

#getObject



18
19
20
# File 'lib/bindata/itypes.rb', line 18

def get
  self.str.force_encoding('UTF-16LE').encode('UTF-8').sub(/\u0000*$/,'')
end

#set(v) ⇒ Object



21
22
23
# File 'lib/bindata/itypes.rb', line 21

def set(v)
  self.str = v.encode('UTF-16LE')
end