Re: [gmime-devel] Encoding headers: Is UTF-8 a sane default now?



On 6/29/2016 10:36 PM, Michael Gratton wrote:

Thanks for the feedback, guys.

So in terms of init'ing GMime to do the right thing: There's nothing to do for US-ASCII headers that will always be used if valid to do so, as long as GMIME_ENABLE_USE_ONLY_USER_CHARSETS is not passed to gmime_init() it will do the same thing for iso-8859-1, and if I call g_mime_set_user_charsets() with just UTF-8, it will use that for all other header strings.

If I do set the user charsets to UTF-8 then I assume that means all headers will be sent as one of those three - i.e. no non-ascii/iso-8859-1 header strings will ever be encoded with something like iso-8859-*, windows-1251 or Shift-JIS, right?

//Mike

I think you're correct, yes.

The gmime-charset-map-private.h list of charsets is used as a way of figuring out which charsets the header values *could* be encoded into and the user-charsets list is used to further filter that down to an "allowed-to-use" subset.

The user-charsets list is also used as a list of charsets to try to convert from when it encounters undeclared 8bit text in the header values.

FWIW, I've removed iso-8859-7 from the list and regenerated the tables in git master, so that should solve the iso-8859-7 issue that your user has hit.

I'd be happy to remove more of them, I just want to be careful about doing that until we get data for those regions that the iso charsets have been deprecated and/or we know that the vast majority of clients used by users in those regions support UTF-8.

Jeff



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