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 …
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éphaneLe jeudi 14 avril 2016 11:30:31 UTC+2, Stéphane MERLE a écrit :
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 …
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.
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
Le jeudi 14 avril 2016 11:30:31 UTC+2, Stéphane MERLE a écrit :
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 …
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éphaneLe jeudi 14 avril 2016 17:29:17 UTC+2, Nando Breiter a écrit :
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
On Thu, Apr 14, 2016 at 2:49 PM, Stéphane MERLE <stephan...@gmail.com <javascript:>> wrote:
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
Le jeudi 14 avril 2016 11:30:31 UTC+2, Stéphane MERLE a écrit :
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 …
Hi Stéphane (VERY long time … the web is a tiny place !)
Running into the same kind of issue running Lucee and various filetypes (cfm, xml, text) and Ajax calls.
As of date, I’m planning to change Lucee’s charset settings to force UTF-8 everywhere.
Point is I’ll have to scan many XML files (they’re mostly dictionaries to support multiples languages including French) and do the job manually because … It’s also an editor issue - Eclipse in my case - that, for those files rely on the XML encoding declaration within the file to display charset property but appears to save the file as ISO-8859-1 (the container default charset). Still have to perform tests against our MS SQL DBs and be sure IIS won’t mess anything either …
Trying to consider it gradually … Not that easy.
Wondering if anything could be considered as “bad practice” on any front before doing the jump (there’s dozens of xml files to edit) … but AFAIK, that’s the only (harassing) way to solve the problem.
EDIT : ouch, sorry for the dig … didn’t notice the year but the month lol.