Re[2]: [Webtest] Request/response encoding problem

ilfrin webtest@lists.canoo.com
Tue, 17 Aug 2004 08:51:50 +0200


Hi Paul,

Thank you very much for the tips, I'll post some resulting findings as
soon as I get any :)

On 16 sierpnia 2004, 23:41:40, you wrote:

PK> 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 .

PK> You can change the character set used for encoding as follows:

PK> <config ...>
PK>    <option name="DefaultCharacterSet" value="ISO-8859-2"/>
PK> </config>

PK> The default is "iso-8859-1"; the above would change it to "ISO-8859-2".
PK> I am not exactly sure whether this is what you need - I never have fully
PK> worked out when you need to change character set and when you need to
PK> change encoding; the default for encoding is "UTF-8".

PK> If this doesn't work, you will probably have to patch the encode()
PK> method in the WebRequest.URLEncodedString class of HttpUnit. It has
PK> special code for dealing with alternate character sets, but you could
PK> change it to handle different encoding types using the overloaded 
PK> URLEncoder.encode() method which takes the encoding type as the second
PK> parameter.

PK> Also, my experience with setting some options for the config is that
PK> they sometimes don't work for the first testSpec inside a target, so you
PK> might want to put a dummy testSpec (with the option as above) ahead of
PK> your current testSpec steps (to which you would also add the above option).


PK> Cheers, Paul.



PK> _______________________________________________
PK> WebTest mailing list
PK> WebTest@lists.canoo.com
PK> http://lists.canoo.com/mailman/listinfo/webtest



-- 

 ilfrin                            mailto:ilfrin@poczta.onet.pl