Skip to main content

I have a workspace on FME Server that sometimes will receive strings with accent as a parameter.

I am calling the workspace with the direct url from a javascript application. I serialize the parameters to be valid in the direct url.

            serialize = function(obj) {
              var str = i];
              for (var p in obj) {
                if (obj.hasOwnProperty(p)) {
                  str.push(encodeURIComponent(p) + "=" + encodeURIComponent(objjp]));
                }
              }
              return str.join("&");
            }

So the string parameter NomProjet = Test ML é become NomProjet=Test%20ML%20%C3%A9 

However, at the end of the workspace, I write the value of the parameter in an Excel file, but the value is blank.

If the parameter does not have accent the output is correct.

What is the problem here? What can be done?

You probably need to decode the text back from URL Encoding. You can use a TextDecoder for this.


You probably need to decode the text back from URL Encoding. You can use a TextDecoder for this.

I tried your idea with encoding type set to URL (percent encoding) and weirdly the output is now 54657374204D4C20E9 instead of being blank for the value Test ML é


You probably need to decode the text back from URL Encoding. You can use a TextDecoder for this.

It appears that the string with accent are encoded in hexadecimal and that I have to decode to latin-1 to make it works.

 

I dont know why it's not encoded in utf-8 at first !?!?


It appears that the string with accent are encoded in hexadecimal and that I have to decode to latin-1 to make it works.

 

I dont know why it's not encoded in utf-8 at first !?!?

Me neither 🙂 but happy it works.


Reply