Buy Now
Sign in

Weird behavior with some UTF-8 characters

flashfs , November 22 2017
I have some some checkboxes with persons names, but some have special characters, like á, ç, ã. When I view them on the HTML page, everything shows fine, but when they are saved on database, they are saved with numeric codes. And I don't think it is only a DB related problem, because I can see the numeric codes when outputting the selection on a Message with {data:name}.
For example: the Ç is showed as \u00c7 on message and database, but at the HTML view it is fine.

[edit] After debugging the component code, I've reached the point where this occurs. On file /libraries/cegcore2/admin/extensions/chronofc/helpers/parser.php, the code
$result = json_encode($result)

is doing this character transformation. I don't know if this is the correct approach, but if I do
$result = json_encode($result, JSON_UNESCAPED_UNICODE)

the accented characters shows fine.
Hi flashfs,

Thanks for the post, this should be fixed in the new update!

Best regards
If your main question got answered then please mark the answer using the button!​
​Please let us know if you have any problems with the new forums text editor, we appreciate your feedback!