You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Travis May <Tr...@sas.com> on 2006/07/24 20:17:12 UTC

UTF-8 Encoding for LoadProperties

I am struggling with some encoding issues.  I have:

	<loadproperties srcFile="my.properties" encoding="UTF8"/>
	<echo message="${message}" />

In my.properties, message is set to "\u00F3"

The output is the less than or equal to sign.

This is the ASCII escape sequence for the less than or equal to sign.  Since that is not an escape sequence in UTF8, shouldn't it output the literal "\u00F3"?  Any workarounds?

Thanks,
Travis

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: UTF-8 Encoding for LoadProperties

Posted by Dominique Devienne <dd...@gmail.com>.
>From the JDK documentation (for example
http://java.sun.com/j2se/1.5.0/docs/api/java/util/Properties.html)

<<<The load and store methods load and store properties in a simple
line-oriented format specified below. This format uses the ISO 8859-1
character encoding. Characters that cannot be directly represented in
this encoding can be written using Unicode escapes ; only a single 'u'
character is allowed in an escape sequence. The native2ascii tool can
be used to convert property files to and from other character
encodings.>>>

So I'm kinda surprised loadproperties offers an encoding attribute,
since the encoding of a properties file should be strictly ISO 8859-1
+ Unicode escapes.

Maybe it converts the specified encoding into "ISO 8859-1 + Unicode escapes"?!

--DD

On 7/24/06, Travis May <Tr...@sas.com> wrote:
> I am struggling with some encoding issues.  I have:
>
>        <loadproperties srcFile="my.properties" encoding="UTF8"/>
>        <echo message="${message}" />
>
> In my.properties, message is set to "\u00F3"
>
> The output is the less than or equal to sign.
>
> This is the ASCII escape sequence for the less than or equal to sign.  Since that is not an escape sequence in UTF8, shouldn't it output the literal "\u00F3"?  Any workarounds?
>
> Thanks,
> Travis
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org