[Mailman-i18n] Problem with Danish characters?

Mark Sapiro mark at msapiro.net
Thu Apr 23 17:08:30 CEST 2009

Kaja P. Christiansen wrote:
>I have (so far) been unable to show correctly Danish characters
>in the names of the list members. Let me give 2 examples.
>Say I create a list 'test' and subscribe a member like here:
>      newlist -l da test kaja at cs.au.dk kaja
>      echo "Kaja Jørgensen <kaja at cs.au.dk>" | add_members -r - -a n -w n test
>to which Mailman responds with:
>      Tilmeldt: Kaja Jørgensen <kaja at cs.au.dk>
>So far so good. Now I ask for the membership list with
>      list_members -f test
>and receive back:
>      Kaja J?rgensen <kaja at cs.au.dk>

The name 'Kaja Jørgensen' is stored internally as a python unicode
object. list_members encodes this for display using the encoding given
by Python's sys.getdefaultencoding(). This in turn defaults to
"ascii". If you want list_members to show non-ascii characters as
other than '?', you have two choices.

You can edit the definition of setencoding() in
/usr/lib/pythonV.V/site.py to replace "ascii" with "iso-8859-1", or
you can edit Mailman's bin/list_members  and replace the line

ENC = sys.getdefaultencoding()


ENC = "iso-8859-1"

>I edit the membership list from the web page:
>- go to Membership List
>- replace member name Kai Nielsen with Kai Jørgensen Nielsen (looks good)
>- submit changes
>- go to another web membership page, then back to one with 'Kai...'
>   and see: Kai J&#248;rgensen Birger Nielsen

Again, the name is properly stored internally. This display is due to
over-protection of the web interface from cross-site-scripting
attacks. The attached file escape_html.patch.txt contains a patch that
will allow these names to display properly in the admin Membership

Mark Sapiro <mark at msapiro.net>        The highway is for gamblers,
San Francisco Bay Area, California    better use your sense - B. Dylan

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: escape_html.patch.txt
URL: <http://mail.python.org/pipermail/mailman-i18n/attachments/20090423/cbbbe873/attachment.txt>

More information about the Mailman-i18n mailing list