Freemarker encoding - question marks in the place of accented characters

后端 未结 4 2085
死守一世寂寞
死守一世寂寞 2021-01-12 16:02

I am trying to print accented characters with Freemarker, but in the place of accented characters, I get only question marks. I have verified, that following statement holds

4条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-12 16:47

    For DROPWIZARD Users: passing through the UTF-8 Charset in the constructor worked out:

    import io.dropwizard.views.View;
    
    import java.nio.charset.Charset;
    
    public class SomeView extends View {
        public SomeView() {
            super("/views/some.ftl", Charset.forName("UTF-8"));
        }
    }
    

提交回复
热议问题