1

I want to use FW/1 to return a string that looks like this:

"Wüf!"

framework.renderData().data("Wüf!").type( "text" );

Note that this is not normal FW/1, but REST

When I run this I get

Wüf!

Postman reports in the headers, Content-Type is

text/plain;charset=utf-8

Update

Visual Code Studio reports that the file is UTF-8

Also EncodeForXML() turns it into

Wüf!

Which is worse

Update 2

I tried

<cfprocessingdirective pageencoding="utf-8">
<cfscript>
component   accessors="true" output="false" extends="concerns.rest" {

    property    beanFactory;
    property    framework;

But I get

enter image description here

James A Mohler
  • 11,060
  • 15
  • 46
  • 72
  • `Wüf!` is exactly what you'd expect if something was receiving the utf-8 encoded string `Wüf!` but treating it as ANSI. Is it possible there are one or more cfm/cfc source files included elsewhere in your request that are ANSI encoded - eg your appliction.cfc? Have you tried adding the old `` trick as a workaround? – Sev Roberts Sep 03 '20 at 11:41
  • See updated question. As for `application.cfc`, there is nothing that sets encoding. – James A Mohler Sep 03 '20 at 17:09
  • I was referring to the encoding of the source files, rather than the presence of any code that sets encoding. You stated that _Visual Code Studio reports that the file is UTF-8_ - but what do you get if you check the encoding of every cf file in the request, eg from Notepad++ -> Encoding? There used to be a JVM arg `-Dfile.encoding=UTF8` you could use to force utf-8 without updating your source, I don't know whether that still works but could be worth trying if you're on a dev environment. I don't know FW/1 but imagine `cfprocessingdirective` would need to be in `onRequest` or `onRequestStart` – Sev Roberts Sep 03 '20 at 17:27

0 Answers0