[ 
http://issues.apache.org/jira/browse/BEEHIVE-1032?page=comments#action_12361382 
] 

Carlin Rogers commented on BEEHIVE-1032:
----------------------------------------

Yes, I agree we need to make the TestRecorder suppport for multibyte more 
robust for use across platforms as well as containers. The container issue is 
tough because configurations are different. Also, I think that in the Servlet 
spec there is a difference between what happens in a GET and a POST.
- With GET the browser URLs encode non-ASCII characters in UTF-8.
- For POST, the header should have a content-type field that specifies the 
actual character encoding of the body.


Just a note... The NetUI automated test suite is generally run on Tomcat. 
Tomcat uses the ISO-8859-1 encoding by default. So, as an out of the box 
soltuion, the TestRecorder as it's implemented, handles non-ASCII multibyte 
characters correctly by taking the ISO-8859-1 bytes and creating a Java Unicode 
String.

So to configure Tomcat 5.0.x for UTF-8 in both the GET and POST I think you 
need to do the following...

1) Add URIEncoding="UTF-8" to the appropriate connector in the server.xml file. 
This will work for GET only on Tomcat. Edit $CATALINA_HOME/conf/server.xml and 
add the attribute URIEncoding="UTF-8" to the <Connector port="8080"... />. For 
example,

  <Connector port="8080"
             maxThreads="150"
             minSpareThreads="25"
             maxSpareThreads="75"
             enableLookups="false"
             redirectPort="8443"
             acceptCount="100"
             debug="0"
             connectionTimeout="20000"
             disableUploadTimeout="true"
             URIEncoding="UTF-8" />

2) To set the encoding correctly for POST requests with multibyte data in the 
form, you can create a servlet filter that sets the encoding to UTF-8 on the 
incoming request. There are lots of examples of this type of configuration on 
the web. 


We'll need to coordinate changes to the TestRecorder code implementation with 
changes to configurations of containers used for automated testing.

> TestRecorder handle request encoding
> ------------------------------------
>
>          Key: BEEHIVE-1032
>          URL: http://issues.apache.org/jira/browse/BEEHIVE-1032
>      Project: Beehive
>         Type: Test
>   Components: NetUI
>     Versions: V1
>     Reporter: Jin Kudo
>  Attachments: step1_patch.txt
>
> Currently the test recorder always handle the request encoding as ISO-8859-1. 
> That is cause to none ASCII characters can't be stored in the recording data 
> file correctly. Request encoding determination is not so easy, but I suggest 
> as the reasonable solution testrecorder use the platform encoding as request 
> encoding rather than fixed ISO-8859-1 value.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira

Reply via email to