Module: Com8ble::String

Defined in:
lib/ffi-chm/com8ble.rb

Instance Method Summary collapse

Instance Method Details

#encode(encoding) ⇒ Object



14
15
16
17
18
19
# File 'lib/ffi-chm/com8ble.rb', line 14

def encode(encoding)
  r = Iconv.conv(_encoding(encoding).name, @encoding.name, self)
  r.extend String
  r.force_encoding encoding
  r
end

#encodingObject



10
11
12
# File 'lib/ffi-chm/com8ble.rb', line 10

def encoding
  @encoding
end

#force_encoding(encoding) ⇒ Object



5
6
7
8
# File 'lib/ffi-chm/com8ble.rb', line 5

def force_encoding(encoding)
  @encoding = _encoding(encoding)
  self
end