Parse code point 0xffff correctly from UTF-8.

Similar to the earlier edge case when printing JSON,
turns out the parsing also has a problem.
Fix comes with a test.

Change-Id: I666724fe9595d3766183cb7da7581b161ec3319e
2 files changed