rodionmoiseev / c10n

A Java library, focused on making internationalisation more modular, easier to evolve and maintain, robust-to-change and IDE-friendly without excess of external tools.
Apache License 2.0
67 stars 10 forks source link

Configure file encoding of message bundles #41

Closed dbenninger closed 7 years ago

dbenninger commented 7 years ago

As I understand it, UTF-8 is currently hard-coded when reading the message bundles. Our message bundles are ISO-8859-1 and it would be nice if we could configure that somehow.

What do you think?

rodionmoiseev commented 7 years ago

Yeah, its hard coded. Seems like it will need a patch to work. There are other work arounds but they are quite complex.

I can think of two ways to do this:

1) Add a new signature for 'bindBundle' method, that accepts read-encoding of the bundle. Keep the old method, defaulting to UFT8. 2) Add a new 'setBundleEncoding' method. Calling this once would set the encoding for all bundles bound. Easier to use, but you will net be able to have mixed encodings.

1) sounds somewhat better to me. What do you think?

rodionmoiseev commented 7 years ago

Sorry, formatting issue: the third point is supposed to say '1) sounds somewhat better to me...'

dbenninger commented 7 years ago

Yes, I would prefer 1) as well...