Help needed with python unicode cgi-bin script

D

Duncan Booth

weheh said:
Hi Duncan, thanks for the reply.
Will this work under the following situation? Let's say the user is
filling out a text field on a form on my website. The user has their
browser encoding set to utf8. My website has charset=windows-1252 as
you indicate above. Will I run into a conflict somewhere?
If you are sending the user a form you should be specifying the acceptable
character sets with the accept-charset attribute on the form tag. Basically
the rule should be to pick an appropriate character set and stick to it.
don't depend on defaults, be explicit.
 
M

Martin v. Löwis

It looks like your suggestions to change charset were incorrect. My example
works equally well with charset=utf8 as it does with charset=windows-1252.

It rather looks like that you didn't follow the suggestions carefully.
In my very first message, I wrote

# Sending "Content-type: text/html" is not enough. The web browser needs
# to know what the encoding is. So you should send
#
# Content-type: text/html; charset="your-encoding-here"

As Duncan Booth explains, this is what you should have done instead - if
you do that, you can also leave the AddDefaultCharset declaration.

Regards,
Martin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,811
Latest member
SaulFernan

Latest Threads

Top