Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: JRuby 0.9.1
-
Fix Version/s: JRuby 1.0.0RC2
-
Component/s: Extensions
-
Labels:None
-
Number of attachments :
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.
BTW, the "json" library depends on the "iconv" instance method:
[...]
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"
[...]