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

Hard coded encoding for all input

Open DALDEI opened this issue 10 years ago • 1 comments

I have created the beginnings of a 'cli' and api based on mustache.java https://github.com/DALDEI/mustache-cli

This is primarily intended to integrate the API portion into xmlsh as an extension module https://github.com/DALDEI/xmlsh

The first need I have is to use native Jackon Node objects as data, and use mustache template files that produce text serialized JSON.

There are multiple issues I am working through - one I ran into is a hard coded encoding for creating Readers and Writers. The readers use either the system encoding or UTF-8, and I havent found OutputStreamWriters that are not in test code.

To solve the input side I have had to subclass MustacheResolver to override the default encodings. ( xmlsh allows runtime settings for all encodings input and out ). Do you think it is reasonable to provide for a setter for the encoding used for creating Writers in the core code so one need not subclass just for this ? I can make a proposal change and submit a pull request.

DALDEI avatar Apr 06 '15 20:04 DALDEI

It seems reasonable to me to set the input/output encoding on the DefaultMustacheFactory

spullara avatar Sep 15 '15 19:09 spullara