[Mailman-Users] 'gb2312' codec can't decode bytes in position 0-1:illegal multibyte sequence

Mark Sapiro mark at msapiro.net
Thu Apr 17 16:23:49 CEST 2008


Fan Liu 
>
>The resolution suggested to intall cjkcodecs, which is provided by python2.4
>now, and add 
>add_language('zh_CN', _('Chinese (China)'), 'gb2312')
>in Defaults.py (as referred to an earlier post
>http://mail.python.org/pipermail/mailman-i18n/2003-September/000976.html). 
>
>Then I run 
>arch --wipe mylist
>
>I encountered such error,
>
>"UnicodeDecodeError: 'gb2312' codec can't decode bytes in position 0-1: illegal
>multibyte sequence"
>
>Any ideas why?  Thanks in advance.


I'm only guessing, but I think it is probably because the
templates/zh-CN/* templates are still encoded as utf-8. You can't
change the character encoding for a language without also recoding all
the templates and the message catalog.

In any case, I question whether the 4+ year old information is even
applicable in current Mailman. I suspect your original issue has to do
with messages in the archive being encoded as utf-8 and the web server
sending a content-type header with a charset other than utf-8. If so,
this is a web server issue. See my comment at
<http://sourceforge.net/tracker/index.php?func=detail&aid=1942206&group_id=103&atid=100103>
for a bit more.

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



More information about the Mailman-Users mailing list