[Tutor] python unicode - help

Kent Johnson kent37 at tds.net
Sat Aug 5 00:55:27 CEST 2006


anil maran wrote:
> postgres takes utf8
> and ie has different encodings, sometimes western, sometimes utf8
> when someone submits data to the form with different,  there is an 
> error, how do we determine the encoding, automatically convert to utf8 
> and then feed to postgres

Generally a browser will return form data in the same encoding as the 
form itself. Set the encoding of the form to utf8 using a meta tag and 
the browser will return utf8 to you. The meta tag looks like this and 
goes in the <head> section of your form:
<meta http-equiv="content-type" content="text/html; charset=utf-8" />

Kent



More information about the Tutor mailing list