charset problems when subscribing with python script
Hello,
I doesn't have access to the add_members script and so I am writing a python script which uses http requests to subscribe new members.
But if I am posting a new member with an name, which includes "German Umlaute" I see only weird characters in the admin-interface.
If I post "Bärbel Rüssel" the admin-interface shows me the following name: "Bärbel Rüssel" I am using the German language setting, so I use ISO-8559-1 charset. If I switch my browser to UTF-8 the name is correct in the admin-interface.
The strange thing for me is, that the name is correct if I subscribe the member in the admin-interface manually. I don't know what's the different between my python script and the manuell subscription.
To Post to my mailman-server I use this recipe (http://code.activestate.com/recipes/146306/) to generate the multipart/form-data POST
I looked into the Mailman source code and found the Util.canonstr method. At the end it changes the string to an unicode string. So the name is stored as unicode, isn't it? But why is there a difference if I display the manuell inserted name and the automatic inserted name??
~ Bernd
Bernd wrote:
I doesn't have access to the add_members script and so I am writing a python script which uses http requests to subscribe new members.
But if I am posting a new member with an name, which includes "German Umlaute" I see only weird characters in the admin-interface.
If I post "Bärbel Rüssel" the admin-interface shows me the following name: "Bärbel Rüssel" I am using the German language setting, so I use ISO-8559-1 charset. If I switch my browser to UTF-8 the name is correct in the admin-interface.
It appears that what may be happening is due to a character set mismatch somewhere. It looks like when "Bärbel Rüssel" is converted to unicode it is actually encoded as utf-8 but is converted as if it were iso-8859-1 encoded.
The strange thing for me is, that the name is correct if I subscribe the member in the admin-interface manually. I don't know what's the different between my python script and the manuell subscription.
I suspect the post data from your script is utf-8 encoded and not iso-8859-1 encoded.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
participants (2)
-
Bernd -
Mark Sapiro