Lucee api and charset with french accent

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

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 …

Thanks for your help.

Stéphane

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: ariamediaOn Thu, Apr 14, 2016 at 2:49 PM, Stéphane MERLE <@Stephane_MERLE> 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 …

Thanks for your help.

Stéphane


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+unsubscribe@googlegroups.com.
To post to this group, send email to lucee@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/lucee/39b28679-f60b-4d6f-95ea-5aee95b24cf4%40googlegroups.com
https://groups.google.com/d/msgid/lucee/39b28679-f60b-4d6f-95ea-5aee95b24cf4%40googlegroups.com?utm_medium=email&utm_source=footer
.

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

Thanks Nando,

I completely agree with this :wink:

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 …

Thanks for your help.

Stéphane


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 <javascript:>.
To post to this group, send email to lu...@googlegroups.com <javascript:>
.
To view this discussion on the web visit
https://groups.google.com/d/msgid/lucee/39b28679-f60b-4d6f-95ea-5aee95b24cf4%40googlegroups.com
https://groups.google.com/d/msgid/lucee/39b28679-f60b-4d6f-95ea-5aee95b24cf4%40googlegroups.com?utm_medium=email&utm_source=footer
.

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

1 Like

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.

1 Like