For Programmers: Free Programming Magazines  


Home > Archive > PERL Programming > January 2006 > Form post encoding problem









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Form post encoding problem
buddyholly83

2006-01-04, 3:18 am

Hi guys and gals!

Been scratching my head about this for a w now and still don't have a solution.

I am making a form post to a web service using the following:

code:
my $userAgent = new LWP::UserAgent; $userAgent -> timeout([10]); $response = $userAgent -> post($uri, [ Username => $username, Password => $password, Account => $account, Body => $body ] );


It works fine for everything except when the $body value has a £ sign in it. The post converts the £ to %A3 - but for utf-8 url encoding £ should be converted to %C2%A3 because £ is outside the ASCII character set, and thus requires two bytes in UTF-8.

I think I need to change the charset the post uses to encode to UTF-8 rather than ISO-8859-1 ?

Not sure what to do?!

Any help would be greatly appreciated! :)
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com