You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by Adam Heath <do...@brainfood.com> on 2010/02/09 07:53:25 UTC

standard encoding of files

Back in December, I fixed groovy class parsing/caching.  To do that, I
introduced UtilIO.readString, to read an entire file into a stream.
However, the implementation wasn't the best.  It uses the single-arg
InputStreamReader.  What that means is that it uses the default
platform charset for converting the bytes to characters.

This is an issue.  When we(ofbiz developers) create the groovy files,
we end up using whatever the default is for each system, commit to
svn, and then have it checked out onto some other system; cue the clowns.

I'm suggest that I'll modify UtilIO.readString, to force the encoding
to always be UTF-8, which is the only sensible thing to do.  This
would mean all files would now have a sane encoding(at least, *.groovy
to start with).

ps: I should have broached this subject when I added UtilIO; we had
this same problem with webslinger, and I went to great pains to force
UTF-8 in all places.

Re: standard encoding of files

Posted by Adam Heath <do...@brainfood.com>.
Christian Geisert wrote:
> Adam Heath schrieb:
> 
> [..]
> 
>> I'm suggest that I'll modify UtilIO.readString, to force the encoding
>> to always be UTF-8, which is the only sensible thing to do.  This
>> would mean all files would now have a sane encoding(at least, *.groovy
>> to start with).
> 
> Or just use ASCII and unicode escaping if necessary.

groovy was just an example; the method in question is supposed to be
used by multiple places.

Re: standard encoding of files

Posted by Christian Geisert <ch...@isu-gmbh.de>.
Adam Heath schrieb:

[..]

> I'm suggest that I'll modify UtilIO.readString, to force the encoding
> to always be UTF-8, which is the only sensible thing to do.  This
> would mean all files would now have a sane encoding(at least, *.groovy
> to start with).

Or just use ASCII and unicode escaping if necessary.

Christian