Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/win32/file/functions.rb

Instance Method Summary collapse

Instance Method Details

#wstripObject

Read a wide character string up until the first double null, and delete any remaining null characters.



45
46
47
48
# File 'lib/win32/file/functions.rb', line 45

def wstrip
  self.force_encoding('UTF-16LE').encode('UTF-8',:invalid=>:replace,:undef=>:replace).
  split("\x00")[0].encode(Encoding.default_external)
end