Class: Ole::Types::Lpwstr

### Home Classes Methods

### In Files

- lib/ole/types/base.rb

### Parent

String

### Methods

- ::dump
- ::load

### Files

- ChangeLog
- README

### Class/Module Index

Quicksearch

- Ole
- Ole::IOMode
- Ole::IOMode::Constants
- Ole::Storage
- Ole::Storage::AllocationTable
- Ole::Storage::AllocationTable::Big
- Ole::Storage::AllocationTable::Small
- Ole::Storage::DirClass
- Ole::Storage::DirClass::Dir
- Ole::Storage::Dirent
- Ole::Storage::FileClass
- Ole::Storage::FileClass::Stat
- Ole::Storage::Header
- Ole::Storage::MetaData
- Ole::Storage::RangesIOMigrateable
- Ole::Storage::RangesIOResizeable
- Ole::Types
- Ole::Types::Clsid
- Ole::Types::Data
- Ole::Types::FileTime
- Ole::Types::Lpstr
- Ole::Types::Lpwstr
- Ole::Types::PropertySet
- Ole::Types::PropertySet::Constants
- Ole::Types::PropertySet::Section
- Ole::Types::Variant
- Ole::Types::Variant::Constants
- RangesIO

No matching classes.

# Ole::Types::Lpwstr

for VT_LPWSTR

for VT_LPWSTR

### Constants

FROM_UTF16
TO_UTF16

### Public Class Methods

dump(str) click to toggle source

    # File lib/ole/types/base.rb, line 60
    def self.dump str
      # need to append nulls?
      data = str.encode(Encoding::UTF_16LE)
      # not sure if this is the recommended way to do it, but I want to treat
      # the resulting utf16 data as regular bytes, not characters.
      data.force_encoding Encoding::ASCII_8BIT
      data
    end

load(str) click to toggle source

    # File lib/ole/types/base.rb, line 56
    def self.load str
      new str.encode(Encoding::UTF_8, Encoding::UTF_16LE).chomp(0.chr)
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.