#18716 closed defect (invalid)
Json stringify doesn't handle unicode characters
Reported by: | pdupless | Owned by: | pdupless |
---|---|---|---|
Priority: | undecided | Milestone: | tbd |
Component: | Core | Version: | 1.10.4 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
Json stringify in the absence of the json object doesn't escape Unicode characters.
Unicode characters can be introduced when copying text into textarea fields from common applications such as Microsoft Outlook.
The addition of the code below to the declaration of the escapeString function would resolve the issue.
.replace(/[\u007f-\uffff]/g, function(c) { return '
u' + ('0000' + c.charCodeAt(0).toString(16)).slice(-4); });
Change History (4)
comment:1 Changed 6 years ago by
comment:2 Changed 6 years ago by
Owner: | set to pdupless |
---|---|
Status: | new → pending |
comment:3 Changed 6 years ago by
Resolution: | → invalid |
---|---|
Status: | pending → closed |
Because we get so many tickets, we often need to return them to the initial reporter for more information. If that person does not reply within 14 days, the ticket will automatically be closed, and that has happened in this case. If you still are interested in pursuing this issue, feel free to add a comment with the requested information and we will be happy to reopen the ticket if it is still valid. Thanks!
comment:4 Changed 6 years ago by
FYI, AFAIK the only character that needs to be escaped is the double quote. It sounds like you had an encoding problem in your app (transferring non-ascii characters to the browsers, or storing non-ascii characters in your database, etc.) and you wanted to use Json stringify to work around the problem.
Why do you think it should escape non-ascii characters?