Free Support Forum - aspose.com

Html to word unicode not rendering

Hello Team,

i am converting a html document to word/docx using below code. The unicode/Japanese text is not rendering in docx. Can you please help.

Thanks,
Lalitya

string html = @"<html><head><title>Test Page</title></head><body><p>統領副総裁とホワイトハウス副相談役</p></body></html>";
            Document theDoc;
            using (MemoryStream mStrm = new MemoryStream(Encoding.UTF8.GetBytes(html)))
            {
                theDoc = new Document(mStrm);
            }
            theDoc.Save("test.docx");

here is the output i got also attached the word document
çµ±é ˜å‰¯ç·è£ã¨ãƒ›ãƒ¯ã‚¤ãƒˆãƒã‚¦ã‚¹å‰¯ç›¸è«‡å½¹

test word docx.zip (10.0 KB)
image.png (1.6 KB)

changing encoding to UTF32 fixed that.

Thanks!

@lalityay

It is nice to hear from you that you have solved your issue. Please feel free to ask if you have any question about Aspose.Words, we will be happy to help you.