Problem with accented characters in input value

38 views
Skip to first unread message

fenaille....@gmail.com

unread,
Aug 26, 2013, 10:23:07 AM8/26/13
to jquery...@googlegroups.com
Hi,
I was using dForm for months generating the JSON content directly as a string. Now, I build it as an object and encode it in JSON but I have problems with value of inputs with accented characters : 'u00e9' for a 'é'. It's normal JavaScript encoding but dForm doesn't escape it (I had the same problem for captions but used htmlentities before encoding it in JSON to have a correct rendering), the data come from database with UTF-8 charset.

Sample with accented value of an input : http://jsfiddle.net/AFdMP/1/

Does someone know why dForm doesn't handle this correctly, or if there is a simple way to fix this ?

Thx for your help,
Julien

Daff

unread,
Aug 26, 2013, 10:35:57 AM8/26/13
to jquery...@googlegroups.com
Julien,

This is just being interpreted as a string. Your special character encoding is wrong.
If you add a backspace instead of the dots it works as expected:

fenaille....@gmail.com

unread,
Aug 26, 2013, 10:48:03 AM8/26/13
to jquery...@googlegroups.com
Thanks for the quick answer and having pointed out my mistake: it was an escaping problem of the '\' in database insert/update. Now I've fixed that, I have nice \u00e9 \u00ef... characters and good dForm rendering.

Sorry for the inconvenience!
Reply all
Reply to author
Forward
0 new messages