
|
If you were logged in you would be able to see more operations.
|
|
|
|
The class methods of Iconv exist, but the instance methods do not. The instance methods are a little more complex because they need to allow partial character calls and then use the left over bytes with the next call. CharsetDecoder and CharsetEncoder is capable of this.
|
|
Description
|
The class methods of Iconv exist, but the instance methods do not. The instance methods are a little more complex because they need to allow partial character calls and then use the left over bytes with the next call. CharsetDecoder and CharsetEncoder is capable of this. |
Show » |
|
[...]
UTF16toUTF8 = Iconv.new('utf-8', 'utf-16be')
UTF8toUTF16 = Iconv.new('utf-16be', 'utf-8'); UTF8toUTF16.iconv('no bom')
rescue Errno::EINVAL
begin
old_verbose = $VERBOSE
$VERBOSE = nil
UTF16toUTF8 = Iconv.new('utf-8', 'utf-16')
UTF8toUTF16 = Iconv.new('utf-16', 'utf-8'); UTF8toUTF16.iconv('no bom')
if UTF8toUTF16.iconv("\xe2\x82\xac") == "\xac\x20"
[...]