[MDEV-13633] JSON_ARRAY() - bad output with some UTF8 characters Created: 2017-08-23 Updated: 2020-10-14 Resolved: 2017-09-13 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Character Sets, JSON |
| Affects Version/s: | 10.2.8 |
| Fix Version/s: | 10.2.9 |
| Type: | Bug | Priority: | Major |
| Reporter: | Michal Hucik | Assignee: | Alexey Botchkov |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Environment: |
CentOS Linux 7.3 |
||
| Issue Links: |
|
||||||||
| Description |
|
I compared the output from JSON_ARRAY () in mariaDB and json_encode () in php-5.6.31. I have found that some of the Czech accent characters are not properly converted to number code (connection setting: SET NAMES UTF8):
And here is output:
|
| Comments |
| Comment by Elena Stepanova [ 2017-08-24 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Thanks for the bug report.
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2017-08-29 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
See also complaint at stackoverflow about JSON_OBJECT: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Rick James (Inactive) [ 2017-08-29 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
You mentioned PHP's json_encode. Is that being used by the client code? Or MariaDB? In any case, use this as a second argument: JSON_UNESCAPED_UNICODE whenever calling json_encode. (This requires PHP 5.4.0.) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Alexey Botchkov [ 2017-09-13 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I think it's fixed, but it's good if Elena doublechecks it. |