Charset windows-1252 vs UTF-8

I have been using Cursor AI for a while and had issues with it using characters that don’t display correctly when served from my server (Win Server 2022), yet are fine from the local side (Windows 10).

Attached example of server vs local
charset-server
charset-local

I’ve noticed that the Charset setting for Lucee (6.2.7.16) on my local install is UTF-8 in all 3 settings but on the server
Template charset - windows-1252
We carset - UTF-8
Resource - windows-1252

I changed all three on the server to UTF-8 and everything seems fine.

All my sites are always tested on my local environment first, so I’m just matching to local

I am not sure why they would be different, but my concern is, am I missing
something? Is there a gotcha with my name on it?

Thanks

@aspirenet when the template charset isn’t set, Lucee uses the JVM’s default file.encoding. On your server that’s windows-1252, which is common on Windows with Java 17 and older. That’s why your server reads the files differently from your local install.

To read templates as UTF-8, set the template charset explicitly, using any one of:

  • Administrator: Settings → Charset → Template charset = UTF-8
  • .CFConfig.json: "templateCharset": "UTF-8"
  • environment variable LUCEE_TEMPLATE_CHARSET=UTF-8 (or system property -Dlucee.template.charset=UTF-8)

Changing them all
Changing them all to default to UTF-8 seemed to fix it. I presume the settings in the json files were updated based on the dashboard settings that I made