Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/win32/file/windows/helper.rb
Instance Method Summary collapse
-
#read_wide ⇒ Object
Read a wide character string up until the first double null, and delete any remaining null characters.
-
#wincode ⇒ Object
Convenience method for converting strings to UTF-16LE for wide character functions that require it.
Instance Method Details
#read_wide ⇒ Object
Read a wide character string up until the first double null, and delete any remaining null characters.
10 11 12 |
# File 'lib/win32/file/windows/helper.rb', line 10 def read_wide self[/^.*?(?=\x00{2})/].delete(0.chr) end |
#wincode ⇒ Object
Convenience method for converting strings to UTF-16LE for wide character functions that require it.
4 5 6 |
# File 'lib/win32/file/windows/helper.rb', line 4 def wincode (self.tr(File::SEPARATOR, File::ALT_SEPARATOR) + 0.chr).encode('UTF-16LE') end |