Accented characters problem with cfheader


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 :


I tested on 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

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:

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.


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

1 Like