Accented characters problem with cfheader

Hi,

Is it normal that when I do this code, the accented characters do not appears to be correct when I look in the Network debug tool of Firefox and Chrome?

<cfheader name="x-message" value="J'aime aller à l'école durant le mois d'août" charset="utf-8">

Result :

header

I tested on trycf.com and the result is always essentially the same, no matter what engine I use. A detail escapes me? Can we put accented characters in a header?

Thank you!

OS: Windows Server 2016 (10.0) 64bit
Java Version: 1.8.0_181 (Oracle Corporation) 64bit
Tomcat Version: Apache Tomcat/8.5.33
Lucee Version: Lucee 5.3.8.206

Well apparently the characters allowed as a value in a header are very limited. I’m looking for official documentation like W3C that talks about it, but so far I came across CloudFlare documentation that talks about it: Format of HTTP request header names and values · Cloudflare Rules docs.

I had success with using URLEncode or EncodeForURL to encode the header value, then URLDecode to decode it. Although it works, I decided to use something other than http headers for the functionality I’m implementing.

2 Likes

I’ve read this very informative post about this topic:

1 Like