You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "Mark H. Wood" <mw...@IUPUI.Edu> on 2013/04/26 16:39:46 UTC

Is there a way to specify encoding of files configured in ?

We have sites in countries where the local language uses non-8859-1
characters, and the local people would like to write interpolated
externalized property values in UTF-8.  Understandably, they would
rather not resort to nearly-unintelligible escape sequences.  Is there
some way to get <build><filters> or a <build><filters><filter> to use
UTF-8 encoding when reading a serialized Properties?

Our projects have long used
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> but
it has no effect on this.  It appears that this only applies to files
*read by Maven*, and that Maven understandably uses
java.util.Properties.load(), which takes no notice of POM values, to
read .properties files.

-- 
Mark H. Wood, Lead System Programmer   mwood@IUPUI.Edu
Machines should not be friendly.  Machines should be obedient.

Re: Is there a way to specify encoding of files configured in ?

Posted by Baptiste MATHUS <ml...@batmat.net>.
Hi,

Could you please give an pom excerpt of what you're trying to do? Or even
better a test project?

If you use .properties files, then Maven might not be the issue here.
Properties files *must* be encoded in iso-8859-1 whatever happens.

Cheers


2013/4/26 Mark H. Wood <mw...@iupui.edu>

> We have sites in countries where the local language uses non-8859-1
> characters, and the local people would like to write interpolated
> externalized property values in UTF-8.  Understandably, they would
> rather not resort to nearly-unintelligible escape sequences.  Is there
> some way to get <build><filters> or a <build><filters><filter> to use
> UTF-8 encoding when reading a serialized Properties?
>
> Our projects have long used
> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> but
> it has no effect on this.  It appears that this only applies to files
> *read by Maven*, and that Maven understandably uses
> java.util.Properties.load(), which takes no notice of POM values, to
> read .properties files.
>
> --
> Mark H. Wood, Lead System Programmer   mwood@IUPUI.Edu
> Machines should not be friendly.  Machines should be obedient.
>
> --
> Baptiste <Batmat> MATHUS - http://batmat.net
> Sauvez un arbre,
> Mangez un castor ! nbsp;!