DocX icon indicating copy to clipboard operation
DocX copied to clipboard

InsertContent not working properly

Open mirkovicmiroslav opened this issue 3 years ago • 2 comments

Hi,

I'm getting bad data once I passed below string in InsertContent()

<p>Тест 1</p>
<p><strong>Тест Болд</strong></p>
<p><em>Тест ем</em></p>

Values inside of HTML tags are Serbian Cyrilic letters, and if I changed them to EN it will work as expected.

Bellow you can see output in docx that I'm getting.

image

How can this be solved?

mirkovicmiroslav avatar Aug 28 '22 22:08 mirkovicmiroslav

As far as I can see from implementation of InsertContent(), <!DOCTYPE html> is inserted at the beginning, but this is not enough. <head...> <meta charset=utf-8" /> is what is missing. Once I wrapped my string with this:

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
</head>
   <p>Тест 1</p>
   <p><strong>Тест Болд</strong></p>
   <p><em>Тест ем</em></p>
</html>

It's working nice and as expected.

mirkovicmiroslav avatar Aug 28 '22 22:08 mirkovicmiroslav

Hi @mirkovicmiroslav , Thank you for this catch ! We will add it for v2.4. Thanks

XceedBoucherS avatar Aug 29 '22 12:08 XceedBoucherS