You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ponymail.apache.org by GitBox <gi...@apache.org> on 2020/08/24 11:06:42 UTC

[GitHub] [incubator-ponymail] sebbASF edited a comment on issue #463: Bug: Archiver#msgbody: poor handling of conversion to string

sebbASF edited a comment on issue #463:
URL: https://github.com/apache/incubator-ponymail/issues/463#issuecomment-679061819


   Note that decode is only invoked if type(body) is bytes, and a successful decode will change body to a string.
   So the decoding uses the first character set only. If that fails, it uses UTF-8.
   
   I agree the current approach is wrong, however changing it will change the output of any generators which depend on the decoded body.
   
   It's vital to ensure that the generators continue to produce the same output for the same input.
   
   I think it should be safe to change the code to use the content-type for the current part, falling back to UTF-8 on error.
   This should fix the output to the most appropriate of the charsets, and should match at least some of the existing generated MIDs. This is not ideal, but is no worse than the current situation.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org