When Pan is used in localized environments, say, German, it emits BROKEN character set declarations in postings. It writes headers like these: MIME-Version: 1.0 Content-Type: text/plain; charset=iso8859-15 It should have written ...charset=iso-8859-15 instead. (mind the dash). This must be attributed to FreeBSD's horrendously wrong decision to use X11 character set names for localization, which breaks compatibility, and harms portability. Impact: Pan postings don't get the non-ASCII characters of ISO 8859 right. This leads to a mutilation of the article display in other software. Fix: Solutions: * fix FreeBSD to use proper locale names * failing that, add code to Pan (backport from Pan2 which does the right thing?) to normalize these charset declarations from FreeBSD's locale to use IANA- registered charset names instead. * remove the Pan port (not recommended)
Responsible Changed From-To: freebsd-ports->gnome Over to the maintainer group.
Can you try the attached patch, and let me know if it works? Thanks. Joe --- gmime/gmime-charset.c.orig Mon Sep 16 16:07:29 2002 +++ gmime/gmime-charset.c Mon Sep 16 16:07:36 2002 @@ -69,7 +69,7 @@ * codeset is a character set or encoding identifier like * ISO-8859-1 or UTF-8. */ - char *codeset, *p; + char *codeset, *p, *tmp; codeset = strchr (locale, '.'); if (codeset) { @@ -77,6 +77,16 @@ /* ; is a hack for debian systems and / is a hack for Solaris systems */ for (p = codeset; *p && !strchr ("@;/", *p); p++); + + if (strstr(codeset, "iso") != NULL && + strlen(codeset) > 3) { + tmp = (char *)g_malloc(strlen(codeset) + 1); + strcpy(tmp, "iso"); + strcat(tmp, "-"); + strcat(tmp, (codeset + 3)); + codeset = tmp; + g_free(tmp); + } locale_charset = g_strndup (codeset, (unsigned) (p - codeset)); g_strdown (locale_charset); } else { -- Joe Marcus Clarke FreeBSD GNOME Team :: marcus@FreeBSD.org http://www.FreeBSD.org/gnome
I hacked upon the previous patch and another one I was sent in private mail, and this one finally works for me: --- gmime/gmime-charset.c.orig Tue Dec 18 21:09:40 2001 +++ gmime/gmime-charset.c Tue Sep 17 00:34:46 2002 @@ -69,15 +69,25 @@ * codeset is a character set or encoding identifier like * ISO-8859-1 or UTF-8. */ - char *codeset, *p; + char *codeset, *tmp = NULL; codeset = strchr (locale, '.'); if (codeset) { codeset++; + if (strncasecmp(codeset, "iso", 3) == 0 && + strlen(codeset) > 3 && + strncasecmp(codeset, "iso-", 4) != 0) { + tmp = (char *)g_malloc(strlen(codeset) + 2); + strcpy(tmp, "iso"); + strcat(tmp, "-"); + strcat(tmp, (codeset + 3)); + codeset = tmp; + } + /* ; is a hack for debian systems and / is a hack for Solaris systems */ - for (p = codeset; *p && !strchr ("@;/", *p); p++); - locale_charset = g_strndup (codeset, (unsigned) (p - codeset)); + locale_charset = g_strndup (codeset, strcspn(codeset, "@;/")); + if (tmp) g_free(tmp); g_strdown (locale_charset); } else { /* charset unknown */
State Changed From-To: open->closed Fixed. Thanks for your help and for reporting.