After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 517244 - Configure doesn't set HAVE_CODESET
Configure doesn't set HAVE_CODESET
Status: RESOLVED FIXED
Product: evolution-data-server
Classification: Platform
Component: Mailer
2.22.x (obsolete)
Other Linux
: Normal normal
: ---
Assigned To: evolution-mail-maintainers
Evolution QA team
Depends on:
Blocks:
 
 
Reported: 2008-02-18 15:52 UTC by Göran Uddeborg
Modified: 2008-05-05 19:06 UTC
See Also:
GNOME target: ---
GNOME version: 2.21/2.22


Attachments
Stole this from GLib (730 bytes, patch)
2008-04-30 22:35 UTC, Matthew Barnes
committed Details | Review

Description Göran Uddeborg 2008-02-18 15:52:33 UTC
When using the locale sv_SE.utf8, evolution by default sends mails claiming they are using charset utf8.  That is not the correct name, it should be UTF-8, and some MUA are fooled by the absence of the dash, and displays the mails incorrectly.

I tried to understand why, and came to this section in libedataserver/e-iconv.c:

#ifdef HAVE_CODESET
		locale_charset = g_strdup (nl_langinfo (CODESET));
		e_strdown (locale_charset);
#else
		/* A locale name is typically of  the  form  language[_terri-
		 * tory][.codeset][@modifier],  where  language is an ISO 639
		 * language code, territory is an ISO 3166 country code,  and
		 * codeset  is  a  character  set or encoding identifier like
		 * ISO-8859-1 or UTF-8.
		 */
		char *codeset, *p;
		
		codeset = strchr (locale, '.');
		if (codeset) {
			codeset++;
			
			/* ; 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, p - codeset);
			e_strdown (locale_charset);
		} else {
			/* charset unknown */
			locale_charset = NULL;
		}
#endif		

When running evolution in the debugger I find to my surprise that the #else section is used, although my system (Fedora) does have CODESET in langinfo.h.  (A trivial two-line test case also confirmed that nl_langinfo(CODESET) indeed does return "UTF-8".)  Since the locale name uses "utf8" rather than "utf-8" it explains the behaviour.

Looking further, I came to the conclusion that nothing in the configure script defines HAVE_CODESET.  I can't find any test for it, and config.h.in doesn't contain it.  That, to me, seems like a bug in evolution-data-server.  Isn't it?
Comment 1 Matthew Barnes 2008-03-11 01:01:51 UTC
Bumping version to a stable release.
Comment 2 Matthew Barnes 2008-04-30 22:35:10 UTC
Created attachment 110195 [details] [review]
Stole this from GLib
Comment 3 Srinivasa Ragavan 2008-05-05 06:31:00 UTC
Test and commit it Matt
Comment 4 Matthew Barnes 2008-05-05 19:06:47 UTC
Committed to trunk (revision 8738) and gnome-2-22 (revision 8739).