How to get the special characters (UTF-8 encoded) from URL parameters properly?
When a WM form receives a URL parameter which can have special characters (UTF-8 encoded). WM form does not decode properly the parameter.
For instance,
1. There is a WM form having a simple URL parameter named 'customername'.
2. The customername parameter can have UTF-8 special characters.
EL??+???BIETA (??+??? in Polish, UTF-8: %C5%BB)
3. The UTF-8 encoded special character was broken when the WM form received the parameter value (which was encoded in UTF-8) at /mvc:eForm/mvc:Control/mvc:customername
Thank you,
Taeho
When a WM form receives a URL parameter which can have special characters (UTF-8 encoded). WM form does not decode properly the parameter.
For instance,
1. There is a WM form having a simple URL parameter named 'customername'.
2. The customername parameter can have UTF-8 special characters.
EL??+???BIETA (??+??? in Polish, UTF-8: %C5%BB)
3. The UTF-8 encoded special character was broken when the WM form received the parameter value (which was encoded in UTF-8) at /mvc:eForm/mvc:Control/mvc:customername
Thank you,
Taeho
RE: UTF-8 characters in URL parameters
I+?+?+?m sorry you have had trouble with this, but hopefully we should be able to get it sorted.
WebMaker should already be set up to use UTF-8 encoding when possible, for example processing of POST parameters should be fine, but I think params in the URL are treated slightly differently.
For these you may need to configure the web server (eg Tomcat) to set which encoding to use.
For tomcat, you need to add the URIEncoding="UTF-8" attribute to the Connector element in the server.xml config file.
For example, if configuring the runtime tomcat in the design studio environment you would adjust the Connector element (line 70) in the '+?+?-?\runtime\tomcat-runtime\conf\server.xml' file to be
<Connector port="7080" protocol="HTTP/1.1" redirectPort="7483" connectionTimeout="20000" maxPostSize="-1" URIEncoding="UTF-8"/>
Have a look at http://wiki.apache.org/tomcat/FAQ/CharacterEncoding#Q2 for more details on this.
I hope this helps you get this resolved, but please let me know if you have any more questions.
Regards,
Gerard
RE: UTF-8 characters in URL parameters
After the configuration changes, WM forms receive UTF-8 encoded URI parameters properly only if the forms are called directly to Tomcat server.
Unfortunately, there are two Tomcat servers running behind an Apache HTTPd proxy server. If the case, WM could not receive utf-8 parameters properly.
Thanks for the information.
Taeho
RE: UTF-8 characters in URL parameters
I+?+?+?m glad you+?+?+?re making progress.
I think there must be some additional configuration changes to make to get it working with the Apache proxy.
If you are using the AJP connector for the proxy then you will need to add the URIEncoding="UTF-8" attribute to the AJP Connector element in the Tomcat server.xml file in addition to the normal HTTP Connector.
From a quick search, I have also seen mention of adding JkOptions +ForwardURICompatUnparsed to the Apache configuration file to help with this area (eg http://hcmc.uvic.ca/blogs/index.php?blog=11&p=9186&more=1&c=1&tb=1&pb=1) but I am not sure exactly what this does!
I guess you may need to experiment a bit, but please let me know how you get on.
Regards,
Gerard
RE: UTF-8 characters in URL parameters
I eventually changed my logic from GET to POST.
It required too much hassles asking IT folks to change the shared resource.
What i did is that create fields and a form elements in main form dynamically thru script, and submit (POST method) to target window.
Thank you,
Taeho
RE: UTF-8 characters in URL parameters
Thanks for letting me know.
I'm glad you found a solution, even if it did require changes to your application. :)
Regards,
Gerard