Velocity template, how to make it render chinese characters correctly?

Hi, I am new to xwiki.
I am trying to fork the oidc authentication extension, and make it works with our private gitlab server.

I tried to modify a velocity template in that extension, adding some chinese characters , but the chinese characters can’t render, just shows some questions marks instead.

I have changed the xwiki locale to chinese already.

please help.

By the way you don’t need to fork it to customize one of the templates, you can simply put your custom template in the skin or in <xwiki home>/templates which have priority over what’s in the oidc JAR (that was the point, provide a simple UI and let anyone write a custom one). See https://extensions.xwiki.org/xwiki/bin/view/Extension/OpenID%20Connect/OpenID%20Connect%20Provider/#HTemplates.

As far as I understand by looking at the code it expect the template to contain UTF8 content, maybe you saved it in a different encoding.

Thanks thomas, I have verified that the file is saved in UTF-8 encoding.

Actually, when I say “fork”, it’s kind of misleading, I just need a customized version of ocid extension, I need to modify some java code to implement some features I need, for example currently our GitLab server does’t return email address in the openid user info response, but I need it to distinguish external user, I just cloned the code and made my own custom one, not a real fork on github.:smiley: