Reputation: 357
I am working with an email system and we are facing issues with encoding. We are sending an XML string via MQ to the email system. The <name>
tag of the XML contains double-byte characters (Japanese kanji). The encoding in the XML string specifies UTF8. When the string is recieved by the email application, they are simply taking each tag and parsing it into the body of the email.
I believe that there is a step missing. Doesn't the receiver/author of the XML string need to add a step before producing the body of the email that will do the proper encoding so the kanji characters can be displayed/printed correctly.
Upvotes: 1
Views: 583
Reputation: 595632
The encoding of the XML states UTF-8 so the content MUST be properly encoded to UTF-8, otherwise the XML is malformed. Email can use many different charsets, so the XML must be decoded to Unicode and then reencoded to whatever charset the email is actually using. Your best option would be to ensure the XML is encoded as UTF-8, validate that upon receiving the XML, then send the email using UTF-8. Then you don't have to worry about decoding the XML and reencoding its content.
Upvotes: 3