You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Steven Anderson <sa...@salesforce.com> on 2005/12/29 02:15:07 UTC

UTF-8 text in a propertyfile?

I'm trying to pass a string of UTF-8 (Japanese) characters via a
property to an xslt task in ant.  

If I set the property in the buildfile, with encoding="UTF-8",
everything works fine.  If I specify the property on the command-line
(in Windows XP), or via a UTF-8 encoded property file, the characters
are not longer UTF-8 (I think they have been turned into ASCII
characters).

Is it possible to set ant properties in a property file with UTF-8
characters?

This seems like an obvious question to ask, but I couldn't find any
mention of it in the Ant documentation or the mailing list.  If I've
missed it, please let me know.

	Steve



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


Re: UTF-8 text in a propertyfile?

Posted by James Fuller <ji...@ruminate.co.uk>.
Steven Anderson wrote:

>I'm trying to pass a string of UTF-8 (Japanese) characters via a
>property to an xslt task in ant.  
>
>If I set the property in the buildfile, with encoding="UTF-8",
>everything works fine.  If I specify the property on the command-line
>(in Windows XP), or via a UTF-8 encoded property file, the characters
>are not longer UTF-8 (I think they have been turned into ASCII
>characters).
>  
>

try setting encoding attribute on loadproperties task.

gl, Jim Fuller


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


Re: UTF-8 text in a propertyfile?

Posted by Stefan Bodewig <bo...@apache.org>.
On Wed, 28 Dec 2005, Steven Anderson <sa...@salesforce.com> wrote:

> If I specify the property on the command-line (in Windows XP), or
> via a UTF-8 encoded property file, the characters are not longer
> UTF-8 (I think they have been turned into ASCII characters).

Probably because the Java VM assumes your native encoding for files
which may not be UTF-8.  I'd opt for Unicode escapes in the properties
file in your case, these \ux1234 sequences - they work independent of
the encoding assumed by your VM.

Stefan

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