Re: [gmime-devel] controling charset used in g_mime_utils_header_encode_text



Hi Paul,

US-ASCII and ISO-8859-1 are currently the exceptions to the user-charsets rule when encoding headers. US-ASCII because it is completely safe for transport and iso-8859-1 because it is expected that every mail client supports this charset.

I just added a g_mime_init() flag (GMIME_ENABLE_USE_ONLY_USER_CHARSETS?) to disable the current behavior and make it only use the user-charsets list to git master.

Jeff

On 5/3/2013 10:02 AM, Paul J Stevens wrote:
Jeff,

is there a way to control the encoding used by mentioned call - and it's
sibling g_mime_utils_header_encode_phrase?

Even when I specifically set a preference to i.e. UTF-8 it keeps
encoding in ISO8859-1:

const char *sets[2] = {
  "UTF-8", "ISO8859-1"
};
g_mime_init(0);
g_mime_set_user_charsets(sets);
char *out = g_mime_utils_header_encode_text("jöst testing");
printf("[%s]\n", out);


still encodes this as

paul shiko:~/test/gmime$ make
gcc -g -Wall -o test test.c `pkg-config --cflags --libs gmime-2.6`
paul shiko:~/test/gmime$ ./test
[=?iso-8859-1?b?avZzdA==?= testing]








[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]