handlebars.java icon indicating copy to clipboard operation
handlebars.java copied to clipboard

Encoding problem in handlebars-proto

Open xtang opened this issue 13 years ago • 4 comments

On handlebars-proto/src/main/java/com/github/jknack/handlebars/server/HbsServlet.java#L121:

Is it better call .setContentType() before .getWriter()?

thanks

xtang avatar Oct 23 '13 04:10 xtang

Can you provide an example?

jknack avatar Oct 26 '13 18:10 jknack

yes, when rendering the template with chinese characters, I expect the charset of response to be 'UTF-8', but it always return the 'ISO8859-1', that lead to the unreadable codes in html.

BTW, after looking at the source code, I think it may be better to give another option to let user set the characterEncoding?

xtang avatar Oct 27 '13 04:10 xtang

fixed in 1.1.3-SNAPSHOT, default encoding is UTF-8 and you can change it from command line with the -e option

jknack avatar Oct 28 '13 00:10 jknack

Cool! thanks!

xtang avatar Oct 28 '13 06:10 xtang