Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Convert chinese encoding GB18030 to UTF-8 doesn't work #3411
Chinese characters encoding in GB18030 can not be converted to UTF-8. If the source encoding is GB2312 everythink works properly.
Here is an example:
Distributor ID: Ubuntu
When I run these lines on ruby 2.1.6p336 (2015-04-13 revision 50298) [x86_64-linux] I get following results:
As you can see both lines returns the same content.
But if I run these lines on jruby 188.8.131.52 (2.2.2) 2015-09-02 583f336 Java HotSpot(TM) 64-Bit Server VM 25.60-b23 on 1.8.0_60-b27 +jit [linux-amd64] I get a different result:
As you can see the second line is not able to encode the string in UTF-8.
I would be very thankful for any help on this issue.