DEV Community


Posted on

Multi-language character support in Thymeleaf

<!DOCTYPE html>
<html xmlns:th="">
    <meta charset="UTF-8"/>

<!--<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">

    Sample test text
    tiếng Việt

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
text is comming like this in pdf

Sample test text ti?ng Vi?t

Vietnamese characters are not comming properly

Top comments (0)