Umlaut problem when creating Excel output

our new application version runs on Lucee and Linux (the old one was on CF and Windows). The program part that creates an Excel document works but all German umlaut characters are wrong (ü für ü).

Not sure where to put a charset specification. Putting it into cfheader doesn’t change anything.

<cfheader name="Content-Type" value="application/vnd.ms-excel" charset="Windows-1252">
<cfheader name="Content-Disposition" value="attachment; filename=#myfilename#" charset="Windows-1252"> 
<cfheader name="Content-Length" value="#len(exceloutput)#" charset="Windows-1252">
<cfcontent type="application/msexcel" reset="true" />
<cfoutput>#exceloutput# including ä ö ü Ä Ö Ü ß</cfoutput>

Try https://docs.lucee.org/reference/tags/pageencoding.html

for some reason, anything that I wrap in CFPAGEENCODING disappears from the output. The generated content is empty.

test page:
https://www.trendfacts.de/maintenance/cfpageencoding.cfm

code of this page:

<p>with page encoding utf-8:</p>
<cfpageencoding charset="utf-8"><p>aou äöü</p></cfpageencoding>
<hr>
<p>with page encoding windows-1252:</p>
<cfpageencoding charset="windows-1252"><p>aou äöü</p></cfpageencoding>
<hr>
<p>without page encoding:</p>
<p>aou äöü</p>

Did you check the encoding of the CFML file? Should be in UTF-8 as well.

Notepad++ did not detect any encoding in the CFM source of cfpageencoding.cfm, so I changed it to UTF-8. That didn’t change anything - the code output that was wrapped in cfpageencoding disappear.
Maybe some misunderstanding on my side? can cfpageencoding be used for parts of a page? maybe not

sorry, my bad, try using
https://docs.lucee.org/reference/tags/processingdirective.html without a body,
as https://cfdocs.org/cfprocessingdirective says it’s actually a compiler directive for the whole file’s pageEncoding

the lucee docs could do with some improvement in this regard

Try installing a font that supports the international characters you need to use.

Once done, restart tomcat / apache / lucee, or your box