Closed danieltoril closed 2 years ago
When calling new java.io.FileWriter
(or new java.io.OuputStreamWriter
or java.nio.file.Files.newBufferedWriter
), the method has an optional java.nio.charset.Charset
parameter, which has an unspecified default value but can be set to java.nio.charset.StandardCharsets.UTF_8
to tell the writer to encode the characters using UTF-8.
I don't think there is a straightforward way to use a explicit charset without specifying the charset independently in both the document's metadata and in the writer.
When calling
new java.io.FileWriter
(ornew java.io.OuputStreamWriter
orjava.nio.file.Files.newBufferedWriter
), the method has an optionaljava.nio.charset.Charset
parameter, which has an unspecified default value but can be set tojava.nio.charset.StandardCharsets.UTF_8
to tell the writer to encode the characters using UTF-8.I don't think there is a straightforward way to use a explicit charset without specifying the charset independently in both the document's metadata and in the writer.
I'm render with HttpServletResponse.getWriter();
.render(FlatHtml.into(response.getWriter()))
How i can change the encoding of response writer?
I'm solved it, when adding:
response.setContentType("text/html");
previously to render to response
Hello, I'm writing a page using your library, it's amazing. I'm migrating my jsp's to your library, but i've a problem with encoding.
meta().withCharset("UTF-8") ... label("Configuración") If i change charset to ISO-8859-1 it works fine, but my original jsp page was working with UTF-8. Thanks in advance!