Problem:
JsonFormat Line ~1281:
case 'u':
// UTF8 escape
code =
(16 * 3 * digitValue(input.charAt(i+1))) +
(16 * 2 * digitValue(input.charAt(i+2))) +
(16 * digitValue(input.charAt(i+3))) +
digitValue(input.charAt(i+4));
i = i+4;
result[pos++] = (byte) code;
break;
Correct (not multiplied but by the Power of 16):
case 'u':
// UTF8 escape
code =
(16 * 16 * 16 * digitValue(input.charAt(i+1))) +
(16 * 16 * digitValue(input.charAt(i+2))) +
(16 * digitValue(input.charAt(i+3))) +
digitValue(input.charAt(i+4));
i = i+4;
result[pos++] = (byte) code;
break;
I attached a version with handels the Umlaute correct.
What steps will reproduce the problem?
1. Build a Message containing a String with Umlaute (äöüÄÖÜäàéè)
2. JsonFormat.print(req.build(), sb);
3. JsonFormat.merge(sb,resp);
What is the expected output? What do you see instead?
The String in the resp Message isn't correct.
I hope this helps to improve this usefull Util.
Original issue reported on code.google.com by helios...@gmail.com on 23 Apr 2011 at 5:23
Original issue reported on code.google.com by
helios...@gmail.com
on 23 Apr 2011 at 5:23Attachments: