4 messages in com.canoo.lists.webtestRe: [Webtest] Request/response encodi...| From | Sent On | Attachments |
|---|---|---|
| Marek Mosiewicz | 16 Aug 2004 01:20 | |
| Paul King | 16 Aug 2004 14:41 | |
| ilfrin | 16 Aug 2004 23:51 | |
| ilfrin | 23 Aug 2004 10:17 |
| Subject: | Re: [Webtest] Request/response encoding problem![]() |
|---|---|
| From: | Paul King (pau...@asert.com.au) |
| Date: | 08/16/2004 02:41:18 PM |
| List: | com.canoo.lists.webtest |
Marek Mosiewicz wrote:
Hello, I repost a message which passed by uncommented, it was sent some time ago by my colleague:
Is there any way to change response encoding. I sent back to the server hidden fields in a form on my page. The whole site is in ISO-8859-2 encoding. The server will acccept only ISO-8859-2 URL encoded parameters, I can't find way to force canoo to chage encoding. Please help .
You can change the character set used for encoding as follows:
<config ...> <option name="DefaultCharacterSet" value="ISO-8859-2"/> </config>
The default is "iso-8859-1"; the above would change it to "ISO-8859-2". I am not exactly sure whether this is what you need - I never have fully worked out when you need to change character set and when you need to change encoding; the default for encoding is "UTF-8".
If this doesn't work, you will probably have to patch the encode() method in the WebRequest.URLEncodedString class of HttpUnit. It has special code for dealing with alternate character sets, but you could change it to handle different encoding types using the overloaded URLEncoder.encode() method which takes the encoding type as the second parameter.
Also, my experience with setting some options for the config is that they sometimes don't work for the first testSpec inside a target, so you might want to put a dummy testSpec (with the option as above) ahead of your current testSpec steps (to which you would also add the above option).
Cheers, Paul.




