lucee api and charset with french accent

59 views
Skip to first unread message

Stéphane MERLE

unread,
Apr 14, 2016, 5:30:31 AM4/14/16
to Lucee
Hi,

I developed an API for our internal management, it's working great for month now but I am stuck on a new silly problem ... accents ...

the API conf in admin is :
Template charset : windows-1252
Web charset : UTF-8
Resource charset : windows-1252

when I use the chrome plugin ADVANCED REST CLIENT APP, it's working fine, I can sent names with accent, no problem ... they arrive ok.
but if I use a php call with CURL, the accent are seen as a capital A with tilde and copyright sign ...
I can see in the firebug that the é is encoded as %C3%A9 which seem to be UTF-8 compliant, the content-type is set to application/x-www-form-urlencoded

How can I check in the coldfusion api, in which charset is the data I receive ? to then know which charset I want and convert it ....

Thanks for your help.

Stéphane

Stéphane MERLE

unread,
Apr 14, 2016, 8:49:38 AM4/14/16
to Lucee
I found the function GetEncoding
I receive UTF-8 for both the php curl call and the advanced rest api ...

So I don't get why the accent are going through for the rest api and not for the curl call ...

Stéphane

Nando Breiter

unread,
Apr 14, 2016, 11:29:17 AM4/14/16
to lu...@googlegroups.com
I don't understand your issue in depth, but the fact that some of the encoding is in windows-1252 might be causing issues. In general, use UTF-8 for everything.



Aria Media Sagl
+41 (0)76 303 4477 cell
skype: ariamedia

--
Love Lucee? Become a supporter and be part of the Lucee project today! - http://lucee.org/supporters/become-a-supporter.html
---
You received this message because you are subscribed to the Google Groups "Lucee" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+un...@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/39b28679-f60b-4d6f-95ea-5aee95b24cf4%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Stéphane MERLE

unread,
Apr 15, 2016, 8:59:48 AM4/15/16
to Lucee
Thanks Nando,

I completely agree with this ;)

all communication is now in UTF8 and with the use of the GetEncoding function, I managed to check that both way where talking UTF8 so the problem wasn't that ...
the PHP code was missing urlencode ... the dev thought that was part of the CURL process ....

So now, it's working fine !

Stéphane
Reply all
Reply to author
Forward
0 new messages