You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Paul Stanton <pa...@mapshed.com.au> on 2012/01/20 04:21:53 UTC

messages bundle containing special characters

Hi all,

I'm looking for the best way to store special characters such as ® 
(&#174; / &reg;) in the messages properties bundle (i.e. app.properties).

I'm aware that I can store the entity name within the bundle and then 
use the 'outputraw' component to render the appropriate symbol in the 
browser, however the messages bundle is sometimes used for non-browser 
functionality and I would prefer to have a more transferable approach.

Is there any alternative?

Thanks, Paul.

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


Re: messages bundle containing special characters

Posted by Paul Stanton <pa...@mapshed.com.au>.
Ah, that's it .. my project/eclipse workspace defaults to ISO-8859-1 
which i thought was recommended.. ?

On 20/01/2012 6:23 PM, Kalle Korhonen wrote:
> On Thu, Jan 19, 2012 at 10:30 PM, Paul Stanton<pa...@mapshed.com.au>  wrote:
>> I did try just the ®initially, however it doesn't seem to work. The
> Make sure you are saving your properties file as UTF-8...
>
> Kalle
>
>
>> unicode-escape sequence does however, so that is what I will go ahead with.
>>
>> key=&reg; \u00AE ®
>>
>> <t:outputraw value="message:key" />
>> ® ® �
>>
>> ${message:key}
>> &reg; ® �
>>
>> Thanks, Paul.
>>
>>
>> On 20/01/2012 3:35 PM, Josh Canfield wrote:
>>> Oh, and Tapestry will read your properties file in UTF8, so you could
>>> just store the ® directly in the file.
>>>
>>> http://tapestry.apache.org/localization.html
>>>
>>> On Thu, Jan 19, 2012 at 8:34 PM, Josh Canfield<jo...@gmail.com>
>>>   wrote:
>>>> Use unicode escapes?
>>>>
>>>>
>>>> http://docs.oracle.com/javase/6/docs/api/java/util/Properties.html#load(java.io.InputStream)
>>>> http://java.sun.com/docs/books/jls/third_edition/html/lexical.html#3.3
>>>>
>>>> \u00AE
>>>>
>>>> http://www.fileformat.info/info/unicode/char/ae/index.htm
>>>>
>>>> Josh
>>>>
>>>> On Thu, Jan 19, 2012 at 7:21 PM, Paul Stanton<pa...@mapshed.com.au>
>>>>   wrote:
>>>>> Hi all,
>>>>>
>>>>> I'm looking for the best way to store special characters such as ®
>>>>> (&#174; /
>>>>> &reg;) in the messages properties bundle (i.e. app.properties).
>>>>>
>>>>> I'm aware that I can store the entity name within the bundle and then
>>>>> use
>>>>> the 'outputraw' component to render the appropriate symbol in the
>>>>> browser,
>>>>> however the messages bundle is sometimes used for non-browser
>>>>> functionality
>>>>> and I would prefer to have a more transferable approach.
>>>>>
>>>>> Is there any alternative?
>>>>>
>>>>> Thanks, Paul.
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>
>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

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


Re: messages bundle containing special characters

Posted by Kalle Korhonen <ka...@gmail.com>.
On Thu, Jan 19, 2012 at 10:30 PM, Paul Stanton <pa...@mapshed.com.au> wrote:
> I did try just the ®initially, however it doesn't seem to work. The

Make sure you are saving your properties file as UTF-8...

Kalle


> unicode-escape sequence does however, so that is what I will go ahead with.
>
> key=&reg; \u00AE ®
>
> <t:outputraw value="message:key" />
> ® ® �
>
> ${message:key}
> &reg; ® �
>
> Thanks, Paul.
>
>
> On 20/01/2012 3:35 PM, Josh Canfield wrote:
>>
>> Oh, and Tapestry will read your properties file in UTF8, so you could
>> just store the ® directly in the file.
>>
>> http://tapestry.apache.org/localization.html
>>
>> On Thu, Jan 19, 2012 at 8:34 PM, Josh Canfield<jo...@gmail.com>
>>  wrote:
>>>
>>> Use unicode escapes?
>>>
>>>
>>> http://docs.oracle.com/javase/6/docs/api/java/util/Properties.html#load(java.io.InputStream)
>>> http://java.sun.com/docs/books/jls/third_edition/html/lexical.html#3.3
>>>
>>> \u00AE
>>>
>>> http://www.fileformat.info/info/unicode/char/ae/index.htm
>>>
>>> Josh
>>>
>>> On Thu, Jan 19, 2012 at 7:21 PM, Paul Stanton<pa...@mapshed.com.au>
>>>  wrote:
>>>>
>>>> Hi all,
>>>>
>>>> I'm looking for the best way to store special characters such as ®
>>>> (&#174; /
>>>> &reg;) in the messages properties bundle (i.e. app.properties).
>>>>
>>>> I'm aware that I can store the entity name within the bundle and then
>>>> use
>>>> the 'outputraw' component to render the appropriate symbol in the
>>>> browser,
>>>> however the messages bundle is sometimes used for non-browser
>>>> functionality
>>>> and I would prefer to have a more transferable approach.
>>>>
>>>> Is there any alternative?
>>>>
>>>> Thanks, Paul.
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>

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


Re: messages bundle containing special characters

Posted by Paul Stanton <pa...@mapshed.com.au>.
Hi Josh,

I did try just the ®initially, however it doesn't seem to work. The 
unicode-escape sequence does however, so that is what I will go ahead with.

key=&reg; \u00AE ®

<t:outputraw value="message:key" />
® ® �

${message:key}
&reg; ® �

Thanks, Paul.

On 20/01/2012 3:35 PM, Josh Canfield wrote:
> Oh, and Tapestry will read your properties file in UTF8, so you could
> just store the ® directly in the file.
>
> http://tapestry.apache.org/localization.html
>
> On Thu, Jan 19, 2012 at 8:34 PM, Josh Canfield<jo...@gmail.com>  wrote:
>> Use unicode escapes?
>>
>> http://docs.oracle.com/javase/6/docs/api/java/util/Properties.html#load(java.io.InputStream)
>> http://java.sun.com/docs/books/jls/third_edition/html/lexical.html#3.3
>>
>> \u00AE
>>
>> http://www.fileformat.info/info/unicode/char/ae/index.htm
>>
>> Josh
>>
>> On Thu, Jan 19, 2012 at 7:21 PM, Paul Stanton<pa...@mapshed.com.au>  wrote:
>>> Hi all,
>>>
>>> I'm looking for the best way to store special characters such as ® (&#174; /
>>> &reg;) in the messages properties bundle (i.e. app.properties).
>>>
>>> I'm aware that I can store the entity name within the bundle and then use
>>> the 'outputraw' component to render the appropriate symbol in the browser,
>>> however the messages bundle is sometimes used for non-browser functionality
>>> and I would prefer to have a more transferable approach.
>>>
>>> Is there any alternative?
>>>
>>> Thanks, Paul.
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

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


Re: messages bundle containing special characters

Posted by Josh Canfield <jo...@gmail.com>.
Oh, and Tapestry will read your properties file in UTF8, so you could
just store the ® directly in the file.

http://tapestry.apache.org/localization.html

On Thu, Jan 19, 2012 at 8:34 PM, Josh Canfield <jo...@gmail.com> wrote:
> Use unicode escapes?
>
> http://docs.oracle.com/javase/6/docs/api/java/util/Properties.html#load(java.io.InputStream)
> http://java.sun.com/docs/books/jls/third_edition/html/lexical.html#3.3
>
> \u00AE
>
> http://www.fileformat.info/info/unicode/char/ae/index.htm
>
> Josh
>
> On Thu, Jan 19, 2012 at 7:21 PM, Paul Stanton <pa...@mapshed.com.au> wrote:
>> Hi all,
>>
>> I'm looking for the best way to store special characters such as ® (&#174; /
>> &reg;) in the messages properties bundle (i.e. app.properties).
>>
>> I'm aware that I can store the entity name within the bundle and then use
>> the 'outputraw' component to render the appropriate symbol in the browser,
>> however the messages bundle is sometimes used for non-browser functionality
>> and I would prefer to have a more transferable approach.
>>
>> Is there any alternative?
>>
>> Thanks, Paul.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>

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


Re: messages bundle containing special characters

Posted by Josh Canfield <jo...@gmail.com>.
Use unicode escapes?

http://docs.oracle.com/javase/6/docs/api/java/util/Properties.html#load(java.io.InputStream)
http://java.sun.com/docs/books/jls/third_edition/html/lexical.html#3.3

\u00AE

http://www.fileformat.info/info/unicode/char/ae/index.htm

Josh

On Thu, Jan 19, 2012 at 7:21 PM, Paul Stanton <pa...@mapshed.com.au> wrote:
> Hi all,
>
> I'm looking for the best way to store special characters such as ® (&#174; /
> &reg;) in the messages properties bundle (i.e. app.properties).
>
> I'm aware that I can store the entity name within the bundle and then use
> the 'outputraw' component to render the appropriate symbol in the browser,
> however the messages bundle is sometimes used for non-browser functionality
> and I would prefer to have a more transferable approach.
>
> Is there any alternative?
>
> Thanks, Paul.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>

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