tapestry-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Imants Firsts <iman...@inbox.lv>
Subject Re: [T5] 5.0.16 Spanish special characters
Date Wed, 03 Dec 2008 17:58:39 GMT
Hi Ray!

The properties files should be in ascii encoding and the unicode characters should be escaped
with \u, for example "\u0161" for &scaron; character. JDK comes with native2ascii tool
that does the conversion.
I have seen an eclipse property editor plugin which saves properties files in this format,
but I myself use the following ant script to convert them.

<project name="Catalog" default="native" basedir=".">
    <property name="native" value="${basedir}/src/main/native"/>
    <property name="resources" value="${basedir}/src/main/resources"/>
    <property name="webapp" value="${basedir}/src/main/webapp"/>

	<target name="native" description="Translates resource files from native encoding to ascii.
Used by eclipse automated build">
		<native2ascii encoding="windows-1257" src="${native}" dest="${webapp}/WEB-INF" includes="**/${ant.project.name}_lv.properties"/>
		<native2ascii encoding="windows-1257" src="${native}" dest="${resources}" includes="**/*_lv.properties"

It can be configured to run automatically when a property file changes or run manually, or
run by a build script.

This converts tapestry main properties file and other native (latvian) files under /src/main/native
in the respective packages

You have to replace the encoding attribute with the encoding of your files, and update suffix
(from _lv to _es). If you have more than one language that needs converting, you will have
to get creative with that script.

Best Regards,

Quoting Ray <fortycoats@gmail.com>:
> Hi there,
> I have a problem in parsing Spanish phrases with special chars. The
> original
> message defined is something like:
> DESCRIPTION=DescripciĆ³n
> comes back as:
> Descripti?n
> from the Messages object. My file format is UTF-8 and my page has the
> appropriate header defined.
> Is there something completely obvious im missing here? Ive tried various
> workrounds, such as defining the unicode escape chars for the special
> chars
> which work for the web page. Problem then is in populating values in a
> dropdown menu where all the unicode escape chars come back as their
> literal
> string equivalents.
> Cheers,
> Ray.

To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org

View raw message