I would appreciate some help with this. I am using Javascript to create a form element on the fly which contains a text input, assign a string to it's value and then submit it to a WEB API method which will accept a FormDataCollection. I am not using JQuery or any other library, I need to post it this way, since the API will return a file and this method was the only one that prompted user to open the file. It works, however new line characters are removed from the file(I also used textarea it didn't help), and also unicode characters are not displayed correctly (for example I get fianc� when input is fiancé (I tried setting the char set to UAT-8, didn't help either), this is the code, thanks a lot for your time!
var mapForm = document.createElement("form");
mapForm.character_set = "utf-8";
mapForm.target ="_self"||"_blank";
mapForm.id="stmtForm";
mapForm.method = "POST";
mapForm.action = "http://blahblahblah;
var mapInput = document.createElement("input");
mapInput.type = "Textarea";
mapInput.name = "psResult";
mapInput.value = psResult;
mapForm.appendChild(mapInput);
document.body.appendChild(mapForm);
mapForm.submit();