Hey folks, i'm stuck in some kind of encoding hell...
# cfml-general
m
Hey folks, i'm stuck in some kind of encoding hell and i can't find the way out... i call a handler function via javascript fetch API this way:
Copy code
fetch('/widgets/buchung/addBooking/', {
        method: 'POST',
        body: formData      
      }).then((response) => { 
        .....and so on.....
and already here if i'm dumping i see encoding problems (these are german umlauts like ä,ü,ö...)
Copy code
remote any function addbooking( event, rc, prc, args={} ) output=false {
		
		var formdata = rc?:'';
		writeOutput(serializeJSON(formdata));
		dump(var=formdata,label="formdata");
all lucee settings and webserver settings are UTF-8, meta-charset tag as well. if i look at the payload in network panel the data is correct - if i look at the preview of the site, data is encoded different...has anyone a hint / good idea for me?
s
just curious, what's the content-type of the response?
s
you need to JSON.stringify(formData) before sending it through
m
@s1deburn response content-type is
text/html;charset=UTF-8
, request content-type
multipart/form-data
at the moment
@Scott Steinbeck thx, i'll look into this!
@s1deburn @Scott Steinbeck i was hunting a phantom-bug. it's just a displaying problem in the dev tools 😞
👍 1