[GODRIVER-1947] UnmarshalExtJSON doesn't handle escaped surrogate pairs Created: 04/Apr/21 Updated: 28/Oct/23 Resolved: 04/May/21 |
|
| Status: | Closed |
| Project: | Go Driver |
| Component/s: | JSON & ExtJSON |
| Affects Version/s: | 1.5.1 |
| Fix Version/s: | 1.5.2 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | David Golden | Assignee: | Matt Dale |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | matt | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
RFC 8259 section 7 requires special handling of surrogate pairs like "\uD834\uDd1e":
`UnmarshalExtJSON` does not properly decode surrogate pairs. Instead it converts each to a Unicode replacement character. Demo program:
Output:
Treatment if ill-formed surrogate pairs (e.g. only one) is often implementation defined. You can find cases to consider in this corpus: https://github.com/nst/JSONTestSuite |
| Comments |
| Comment by Githook User [ 04/May/21 ] |
|
Author: {'name': 'Matt Dale', 'email': '9760375+matthewdale@users.noreply.github.com', 'username': 'matthewdale'}Message:
|
| Comment by Githook User [ 03/May/21 ] |
|
Author: {'name': 'Matt Dale', 'email': '9760375+matthewdale@users.noreply.github.com', 'username': 'matthewdale'}Message:
|
| Comment by Matt Dale [ 26/Apr/21 ] |