views:

310

answers:

3

I have an ASP.NET application that needs to send emails in Korean. These emails are sent in plaintext.

But when the emails are received, they look like this:

? First name? ??: ?????.

?? ???? ???? ?? ??? ??? ?? ???? ???? ????? ???? ????. ??????? ??? ????? ???? ??? ??1-888-123-4567 ? ??????? ?? [email protected] ?? ?????? ???? ??? ??????.

Currently I'm not setting the encoding. Just using the default. Ideally, I would like the encoding to work with all sorts of emails. Hopefully I don't have to set the encoding on a per-email basis.

A: 

Hi,
What character encoding are you using to send those emails?

jdecuyper
Currently I'm not setting the encoding. Just using the default.
Keltex
Did you try encoding the text in UTF-8? I also had a lots of troubles with spanish characters. The <a href="http://www.joelonsoftware.com/articles/Unicode.html">article about encoding types by Joel Spolsky</a> helped me a lot understanding what to do.
jdecuyper
Sorry for the bad URL. The correct one is: http://www.joelonsoftware.com/articles/Unicode.html
jdecuyper
+1  A: 

Try setting the encoding of the email to UTF-8.

I think this would be the line you need in the email headers:

Content-Type: text/plain; charset=UTF-8

Hope this helps

Adam

adamisnt
+2  A: 

You basically have 2 ways to encode email parts:

  1. Using the Korean Code page for your email so people not using Unicode can still view it (charsets like ISO-2022-KR and x-windows-949 , I don't know which of the 3 is the most common):

    Content-Type: text/plain;
    charset="EUC-KR"
    Content-Transfer-Encoding: quoted-printable
    
  2. Using UTF8 encoding, which is the preferred way nowadays.
    In any case, the recipient must have proper support for Asian languages installed on their machine for the message to display correctly.

    Content-Type: text/plain; charset=UTF-8;
    Content-Transfer-Encoding: 8bit
    

Here are a couple of good articles that explain how to implement this properly:

Renaud Bompuis