DEV Community

shubhamgarg
shubhamgarg

Posted on

Multi-language character support in Thymeleaf

<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8"/>
</head>

<!--<body style="width: 900px; margin: 0 auto; color: #111; font-family: Arial Unicode MS; font-size: 12px;-->
<!--    line-height: normal; box-sizing: border-box;">-->
<body style="font-family: Barlow">

<div>
    Sample test text
    tiếng Việt
</div>

</body>
</html>
Enter fullscreen mode Exit fullscreen mode
templateEngine.process("template.html", context);

Enter fullscreen mode Exit fullscreen mode

I am using this template.html file with Vietnamese text in it
and trying to generate pdf from it by using Thymeleaf.TemplateEngine
but,
text is comming like this in pdf

Sample test text ti?ng Vi?t

Vietnamese characters are not comming properly

Latest comments (0)