![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
Hi,
I am using Redemption create Outlook messages. I have noticed some messages not displaying proper characters in Outlook. For example: I am creating some messages which has chinese characters. See below the META tag of the HTML. meta http-equiv="Content-Type" content="text/html; charset=big5" In the C# debugger, I can see "htmlBody" contains correct the characters but the message showing garbase. message.HTMLBody = htmlBody; // htmlBody ok Also the OutlookSpy CurrectItem.HTMLBody shows correct format. Do I need to set some other properties in Outlook? Thanks for the advice. Regards, MA |
Ads |
#2
|
|||
|
|||
![]()
I have noticed, settings the InternetCodepage shows the correct
characters. -------------------------------------------------- message.HTMLBody = htmlBody; message.InternetCodepage = 52936; -------------------------------------------------- Is this the best way to solve the issue? Regards, MA |
#3
|
|||
|
|||
![]()
Have you tried to HTML-encode the Chinese characters first?
Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool "MA" wrote in message ... Hi, I am using Redemption create Outlook messages. I have noticed some messages not displaying proper characters in Outlook. For example: I am creating some messages which has chinese characters. See below the META tag of the HTML. meta http-equiv="Content-Type" content="text/html; charset=big5" In the C# debugger, I can see "htmlBody" contains correct the characters but the message showing garbase. message.HTMLBody = htmlBody; // htmlBody ok Also the OutlookSpy CurrectItem.HTMLBody shows correct format. Do I need to set some other properties in Outlook? Thanks for the advice. Regards, MA |
#4
|
|||
|
|||
![]()
Yes, I have a helper method which read from the file. The method takes
the file path and encoding. helper.LoadFromFile(filePath, Encoding.GetEncoding("big5")); Hope I haven't mis-understood your question. Does my question above make sense? Do I have to set the "InternetCodepage" property? Regards, MA |
#5
|
|||
|
|||
![]()
No, I meant encoding the actual Chinise characters as &#XYZ;
E,g. Ђ Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool "MA" wrote in message ... Yes, I have a helper method which read from the file. The method takes the file path and encoding. helper.LoadFromFile(filePath, Encoding.GetEncoding("big5")); Hope I haven't mis-understood your question. Does my question above make sense? Do I have to set the "InternetCodepage" property? Regards, MA |
#6
|
|||
|
|||
![]()
Thanks "Dmitry" for your response.
I will try to explain below the source of the message my steps: 1) The Outlook message HTMLBody comes from a external HTML file. Example of the HTML source: --------------------------------------------- html head title¨C ¤é ¶× ¥« ² ³ø/title meta http-equiv="Content-Type" content="text/html; charset=big5" /head body bgcolor="#FFFFFF" link="#003A9A" vlink="#003A9A" alink="#003A9A" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" table width="100%" border="0" cellspacing="0" cellpadding="0" ....... --------------------------------------------- 2) My program read the "charset" value from the HTML (use the default encoding in first pass), then use the charset value (i.e. "big5") to decodes to string. bytes = LoadFromFile(path); htmlBody = Encoding.GetEncoding("big5").GetString(bytes); 3) Set the Outlook message HTMLBody. message.HTMLBody = htmlBody As I said earlier, I can see garbage characters in Outlook message. Outlook message, view source shows the "charset=big5". If I use the OutlookSpy-CurrentItem, the HTMLBody inside the OutlookSpy shows correct format. Why the same message in Outlook client shows garbage and OutlookSpy shows correct? Also said earlier, if I set the "InternetCodepage" then the message shows correctly in Outlook. Any pros and cons about this approach? Thanks in advance for your suggestions. Regards, MA |
#7
|
|||
|
|||
![]()
That should be Ok, but ideally HTML encoding all characters would be much
better. Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool "MA" wrote in message ... Thanks "Dmitry" for your response. I will try to explain below the source of the message my steps: 1) The Outlook message HTMLBody comes from a external HTML file. Example of the HTML source: --------------------------------------------- html head title¨C ¤é ¶× ¥« ² ³ø/title meta http-equiv="Content-Type" content="text/html; charset=big5" /head body bgcolor="#FFFFFF" link="#003A9A" vlink="#003A9A" alink="#003A9A" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" table width="100%" border="0" cellspacing="0" cellpadding="0" ........ --------------------------------------------- 2) My program read the "charset" value from the HTML (use the default encoding in first pass), then use the charset value (i.e. "big5") to decodes to string. bytes = LoadFromFile(path); htmlBody = Encoding.GetEncoding("big5").GetString(bytes); 3) Set the Outlook message HTMLBody. message.HTMLBody = htmlBody As I said earlier, I can see garbage characters in Outlook message. Outlook message, view source shows the "charset=big5". If I use the OutlookSpy-CurrentItem, the HTMLBody inside the OutlookSpy shows correct format. Why the same message in Outlook client shows garbage and OutlookSpy shows correct? Also said earlier, if I set the "InternetCodepage" then the message shows correctly in Outlook. Any pros and cons about this approach? Thanks in advance for your suggestions. Regards, MA |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Chinese characters in English subject | George Coulas | Outlook - General Queries | 0 | December 5th 07 05:07 PM |
HTMLBody with images | tim johnson | Outlook and VBA | 5 | February 1st 07 12:30 AM |
How to set a long HTMLBody | mml | Outlook and VBA | 1 | October 28th 06 06:39 PM |
HTMLBody | Houston Lucifer | Outlook and VBA | 5 | July 17th 06 12:16 PM |
Spaces Removed in HTMLBody | [email protected] | Outlook and VBA | 3 | June 6th 06 08:02 PM |