Question

Prevent parameters containing accents in direct url to be encoded into hexadecimal

  • 5 July 2019
  • 1 reply
  • 2 views

Badge

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 with browser's encodeURIComponent function to be valid in the direct url.

 

So a string parameter like NomProjet = é become NomProjet=%C3%A9

I found out that parameters, when they are containing accents, are automatically encoded into hexadeciamal by FME Server. So the parameter é become E9 in the workspace. I have to use a TextDecoder to decode them to Latin-1. However, when the parameter does not contain accents, it's not encoded to hex and the TextDecoder produce an error.

 

I would like to prevent FME Server to encode those parameters into hexadecimal. Utf-8 would be perfect. Is there a way to do that?

 


1 reply

Badge +10

Hi @bgeorges,

It sounds like your stuck using encodeURIComponent , which sometimes converts to hex depending on the parameter value. There is probably not a way to encode the parameter values before the value enters the workspace with FME Server. It sounds like the "URL (Percent Encoding)" in the TextDecoder should have worked in the workspace, so any reproduction you can supply would very helpful in making sure we are understanding the issue.

Richard

Reply