first of all thank you all very much. there are many people around here contributing pretty good solutions to all those questions that come up implementing your processes.
i have a question regarding input data coming from the HTTP Server Input node. to my surprise i could not find anything in the forums.
we have implemented a web interface, where visitors input some data, which is then sent to the http server input node as a get-request. the data is then processed in the workflow. everything is fine. almost!
as we are located in germany, we have to deal with umlauts. so i need to get the encoding from the http-header. how can i do that?
within a python script we are getting the get-parameters from the Watch-object like this (eg parameter ‘order’):
i didnt realize there is a translator-plugin. but im afraid it is not perfectly to the point. only telling by the screenshot it looks like you have to set the encoding in the plugin statically. but as this is a webform, every client using it will have different encodings in place. windows will use cp1252, osx likely to use utf8, and so on. so the workflow has to evaluate some header data to get it right. you cannot guess encodings.
(i have not checked the plugin though, so if there is intelligence in it to analyze header data and react on it, then forget the former paragraph.)
so is the plugin that smart, or do i have to take something else into consideration?
yes it is! but what do i put in there, to evaluate the encoding of the current jobfile? how do i access that piece of information, that is likely to be located in the header line as i mentioned in my initial posting? i guess if i knew the path to that variable, i could access it as well in a script…
Add a local variable to the process (ex: encodingType or encodingHeader)
After the HTTP Server Input, add the “Change Emulation” action and set it to Line Printer
Then add the Set Job Infos and Variables and set the Value of the variable encodingType by right-clicking in the box and selecting “Get Data Location” and select the first line which reads: <?xml version=“1.0” encoding=“windows-1252”?>
You can then add a Run Script (using RegEX in VBScript, JavaScript or Python) to only extract the encoding value and assign it to your variable.
Then Change Emulation back to XML if you want to continue with a XML formatted data.