DocX
DocX copied to clipboard
InsertContent not working properly
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.

How can this be solved?
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.
Hi @mirkovicmiroslav , Thank you for this catch ! We will add it for v2.4. Thanks