Re: Problem with Euro symbol

2006-12-05 Thread Ron Piterman
Sam Gendler wrote:
 The symbol you are seeing is the symbol used to denote 'locale
 specific currency symbol' in a format pattern.  What is strange is
 that if you don't have a symbol for that currency in your current
 locale, you should get the ISO 3-letter code (EUR, in this case)
 rather than a euro symbol.  Is it possible that you are escaping the
 currency symbol in your format string, so that the currency symbol
 itself is being rendered to the output, rather than having it replaced
 by the correct currency within the formatter?

The formatter is the standard Java formatter - so I don't escape
anything - I count on tapestry to do that.

The wrapper format object does not do anything with formatting, it just
manipulates the passed object before this is formatted by the java
currency format - it takes the long and passes a float which is the
original long divided by 100.

 
 The only other thought I have is that you are telling your browser
 that the file is UTF-8 via the meta header, but you may well not have
 told Tapestry to spit out UTF-8 characters, resulting in the browser
 rendering the generic currency symbol. Putting the meta
 http-equiv=Content-Type content=text/html;charset=UTF-8/ line in
 the template is not the only thing necessary to get your documents in
 UTF-8 correctly. That just tells the browsewr what to expect.
If I would, i would have used the tapestry configuration to change the
encoding - but actually I don't change the encoding at all, tapestry is
using utf-8 by default.

The line showing the meta in my postings was not taken from my template,
but from the html tapestry's shell component renders.

 Tapestry
 will use the default charset of the JVM when reading and writing to
 streams, so if your default charset is not a superset of UTF-8, you
 could easily wind up with characters that don't translate correctly.

Tapestry is set to use utf-8 by default - and I suspect it gets a string
€ 1000 - and should encode it the right way.

 You can discover your default charset by simply printing
 Charset.defaultCharset() to your logs.  If you aren't running in
 UTF-8, try telling the JVM that is running Tapestry to use UTF-8.  You
 can only change the default charset at startup.  Add
 -Dfile.encoding=UTF-8 to your JAVA_OPTS var before running tomcat.
 That will cause all templates and properties values to be rendered to
 the client as UTF-8.

I will look again at this problem at friday, and will debug into it to
learn more - this is somewhat heavier because using jboss, so debugging
isn't fun at all :(

Thanx !
Cheers,
Ron


 
 And yes, please let's take i18n very seriously as it is rare for me to
 have to develop apps that aren't translated into several different
 languages and charsets (cyrillic being the usual culprit when it comes
 to problems)
 
 --sam
 
 On 12/4/06, Jesse Kuhnert [EMAIL PROTECTED] wrote:
 If you get to something more definitive let me know. I should probably
 take i18n issues very seriously considering the percentage of
 users/developers coming from countries not using english as the
 default native language.

 On 12/4/06, Ron Piterman [EMAIL PROTECTED] wrote:
  not yet - there is no ajax/json involved :(
  but I will update and see...
 
  Cheers,
  Ron
 
 
  Jesse Kuhnert wrote:
   Not sure if you were bitten by the same encoding of ajax/json bug
 that
   others were from this weekends changes but a new release was just
   published that should fix any issues related to that.
  
   On 12/4/06, Ron Piterman [EMAIL PROTECTED] wrote:
  
   Thanx, but I am using:
  
   public Format getCurrencyFormat() {
 Locale l = getPage().getEngine().getLocale();
 return new NumberTranslatorFormat(
 NumberFormat.getCurrencyInstance( l
   ) );
   }
  
   the NumberTranslatorFormat is a custom format which devides or
   multiplies the numbers, but is delegating formatting to the given
   CurrencyFormat.
  
   :(
  
   Cheers,
   Ron
  
  
  
   Christian Haselbach wrote:
Zitat von Ron Piterman [EMAIL PROTECTED]:
   
   
   The € is comming from the java currency format object:
   NumebrFormat.getCurrencyInstance();
   
   
Just a guess. You are using a number format without specifying
the locale. Hence, the default locale for your platform is
used which propably includes the encoding latin9. The code
which denotes the euro symbol in latin9 denotes the currency
symbol in latin1 and (IIRC) in UTF-8. Thus, you see the currency
symbol, not the expected euro symbol.
   
Regards,
Christian.
   
   
 -
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
   
   
  
  
  
 -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
  
  
  
  
 
 
  -
  To 

Problem with Euro symbol

2006-12-04 Thread Ron Piterman

Hi all,
I am using
span jwcid=@Insert value=ognl:sum fomrat=ognl:currencyFormat
/span

the currency format is a java standard currency format, but the Euro 
symbol is not inserted properly so one gets a ¤ instead of € -


any idea why and how to change that?

the page includes the standard
meta http-equiv=Content-Type content=text/html;charset=UTF-8/

which is generated by the Shell component.

Cheers,
Ron


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Problem with Euro symbol

2006-12-04 Thread Andrea Chiumenti

try  ISO-8859-15, what happen ?
and is fomrat really what you have on src ? If so correct with format
kiuma

On 12/4/06, Ron Piterman [EMAIL PROTECTED] wrote:


Hi all,
I am using
span jwcid=@Insert value=ognl:sum fomrat=ognl:currencyFormat
/span

the currency format is a java standard currency format, but the Euro
symbol is not inserted properly so one gets a ¤ instead of € -

any idea why and how to change that?

the page includes the standard
meta http-equiv=Content-Type content=text/html;charset=UTF-8/

which is generated by the Shell component.

Cheers,
Ron


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Problem with Euro symbol

2006-12-04 Thread Ron Piterman

Andrea Chiumenti wrote:

try  ISO-8859-15, what happen ?


nothing changes :(


and is fomrat really what you have on src ? If so correct with format


no, fomrat was just a typo in the posting.


kiuma

On 12/4/06, Ron Piterman [EMAIL PROTECTED] wrote:



Hi all,
I am using
span jwcid=@Insert value=ognl:sum fomrat=ognl:currencyFormat
/span

the currency format is a java standard currency format, but the Euro
symbol is not inserted properly so one gets a ¤ instead of € -

any idea why and how to change that?

the page includes the standard
meta http-equiv=Content-Type content=text/html;charset=UTF-8/

which is generated by the Shell component.

Cheers,
Ron


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]







-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Problem with Euro symbol

2006-12-04 Thread Ron Piterman

The € is comming from the java currency format object:
NumebrFormat.getCurrencyInstance();
Cheers,
Ron

Andrea Chiumenti wrote:

is your java src in UTF-8 ?
What if you hardcode € into your teplate ? does it correctly display ?
and what if you put into java src public String getEuro() {return €;}
and then into div jwcid=@Insert value=ognl:euro/ ?

On 12/4/06, Ron Piterman [EMAIL PROTECTED] wrote:



Andrea Chiumenti wrote:
 try  ISO-8859-15, what happen ?

nothing changes :(

 and is fomrat really what you have on src ? If so correct with format

no, fomrat was just a typo in the posting.

 kiuma

 On 12/4/06, Ron Piterman [EMAIL PROTECTED] wrote:


 Hi all,
 I am using
 span jwcid=@Insert value=ognl:sum fomrat=ognl:currencyFormat
 /span

 the currency format is a java standard currency format, but the Euro
 symbol is not inserted properly so one gets a ¤ instead of € -

 any idea why and how to change that?

 the page includes the standard
 meta http-equiv=Content-Type content=text/html;charset=UTF-8/

 which is generated by the Shell component.

 Cheers,
 Ron


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]







-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Problem with Euro symbol

2006-12-04 Thread Ron Piterman

When inside the template, the € symbol is rendered fine.

strange thing...

any idea ?

Cheers,
Ron


Andrea Chiumenti wrote:

is your java src in UTF-8 ?
What if you hardcode € into your teplate ? does it correctly display ?
and what if you put into java src public String getEuro() {return €;}
and then into div jwcid=@Insert value=ognl:euro/ ?

On 12/4/06, Ron Piterman [EMAIL PROTECTED] wrote:



Andrea Chiumenti wrote:
 try  ISO-8859-15, what happen ?

nothing changes :(

 and is fomrat really what you have on src ? If so correct with format

no, fomrat was just a typo in the posting.

 kiuma

 On 12/4/06, Ron Piterman [EMAIL PROTECTED] wrote:


 Hi all,
 I am using
 span jwcid=@Insert value=ognl:sum fomrat=ognl:currencyFormat
 /span

 the currency format is a java standard currency format, but the Euro
 symbol is not inserted properly so one gets a ¤ instead of € -

 any idea why and how to change that?

 the page includes the standard
 meta http-equiv=Content-Type content=text/html;charset=UTF-8/

 which is generated by the Shell component.

 Cheers,
 Ron


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]







-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Problem with Euro symbol

2006-12-04 Thread Andrea Chiumenti

mmm...
NumebrFormat.getCurrencyInstance()

Locale defaultLocale = new Locale(fr, FR, EURO);

NumberFormat nf = NumberFormat.getCurrencyInstance(defaultLocale);

String formattedValue = nf.format(value);

System.out.println(formattedValue);

Try then
. new String(formattedValue.getBytes(ISO-8859-1));
or
. new String(formattedValue.getBytes(UTF-8));
etc:
http://java.sun.com/j2se/1.4.2/docs/api/java/nio/charset/Charset.html


Let me know.
kiuma

On 12/4/06, Ron Piterman [EMAIL PROTECTED] wrote:


The € is comming from the java currency format object:
NumebrFormat.getCurrencyInstance();
Cheers,
Ron

Andrea Chiumenti wrote:
 is your java src in UTF-8 ?
 What if you hardcode € into your teplate ? does it correctly display ?
 and what if you put into java src public String getEuro() {return €;}
 and then into div jwcid=@Insert value=ognl:euro/ ?

 On 12/4/06, Ron Piterman [EMAIL PROTECTED] wrote:


 Andrea Chiumenti wrote:
  try  ISO-8859-15, what happen ?

 nothing changes :(

  and is fomrat really what you have on src ? If so correct with format

 no, fomrat was just a typo in the posting.

  kiuma
 
  On 12/4/06, Ron Piterman [EMAIL PROTECTED] wrote:
 
 
  Hi all,
  I am using
  span jwcid=@Insert value=ognl:sum fomrat=ognl:currencyFormat
  /span
 
  the currency format is a java standard currency format, but the Euro
  symbol is not inserted properly so one gets a ¤ instead of € -
 
  any idea why and how to change that?
 
  the page includes the standard
  meta http-equiv=Content-Type content=text/html;charset=UTF-8/
 
  which is generated by the Shell component.
 
  Cheers,
  Ron
 
 
 
-
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Problem with Euro symbol

2006-12-04 Thread Christian Haselbach
Zitat von Ron Piterman [EMAIL PROTECTED]:

 The € is comming from the java currency format object:
 NumebrFormat.getCurrencyInstance();

Just a guess. You are using a number format without specifying
the locale. Hence, the default locale for your platform is
used which propably includes the encoding latin9. The code
which denotes the euro symbol in latin9 denotes the currency
symbol in latin1 and (IIRC) in UTF-8. Thus, you see the currency
symbol, not the expected euro symbol.

Regards,
Christian.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Problem with Euro symbol

2006-12-04 Thread Ron Piterman

Thanx, but I am using:

public Format getCurrencyFormat() {
 Locale l = getPage().getEngine().getLocale();
 return new NumberTranslatorFormat( NumberFormat.getCurrencyInstance( l 
) );

}

the NumberTranslatorFormat is a custom format which devides or 
multiplies the numbers, but is delegating formatting to the given 
CurrencyFormat.


:(

Cheers,
Ron



Christian Haselbach wrote:

Zitat von Ron Piterman [EMAIL PROTECTED]:



The € is comming from the java currency format object:
NumebrFormat.getCurrencyInstance();



Just a guess. You are using a number format without specifying
the locale. Hence, the default locale for your platform is
used which propably includes the encoding latin9. The code
which denotes the euro symbol in latin9 denotes the currency
symbol in latin1 and (IIRC) in UTF-8. Thus, you see the currency
symbol, not the expected euro symbol.

Regards,
Christian.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Problem with Euro symbol

2006-12-04 Thread Jesse Kuhnert

Not sure if you were bitten by the same encoding of ajax/json bug that
others were from this weekends changes but a new release was just
published that should fix any issues related to that.

On 12/4/06, Ron Piterman [EMAIL PROTECTED] wrote:

Thanx, but I am using:

public Format getCurrencyFormat() {
  Locale l = getPage().getEngine().getLocale();
  return new NumberTranslatorFormat( NumberFormat.getCurrencyInstance( l
) );
}

the NumberTranslatorFormat is a custom format which devides or
multiplies the numbers, but is delegating formatting to the given
CurrencyFormat.

:(

Cheers,
Ron



Christian Haselbach wrote:
 Zitat von Ron Piterman [EMAIL PROTECTED]:


The € is comming from the java currency format object:
NumebrFormat.getCurrencyInstance();


 Just a guess. You are using a number format without specifying
 the locale. Hence, the default locale for your platform is
 used which propably includes the encoding latin9. The code
 which denotes the euro symbol in latin9 denotes the currency
 symbol in latin1 and (IIRC) in UTF-8. Thus, you see the currency
 symbol, not the expected euro symbol.

 Regards,
 Christian.

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
Jesse Kuhnert
Tapestry/Dojo team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Problem with Euro symbol

2006-12-04 Thread Ron Piterman

not yet - there is no ajax/json involved :(
but I will update and see...

Cheers,
Ron


Jesse Kuhnert wrote:

Not sure if you were bitten by the same encoding of ajax/json bug that
others were from this weekends changes but a new release was just
published that should fix any issues related to that.

On 12/4/06, Ron Piterman [EMAIL PROTECTED] wrote:


Thanx, but I am using:

public Format getCurrencyFormat() {
  Locale l = getPage().getEngine().getLocale();
  return new NumberTranslatorFormat( NumberFormat.getCurrencyInstance( l
) );
}

the NumberTranslatorFormat is a custom format which devides or
multiplies the numbers, but is delegating formatting to the given
CurrencyFormat.

:(

Cheers,
Ron



Christian Haselbach wrote:
 Zitat von Ron Piterman [EMAIL PROTECTED]:


The € is comming from the java currency format object:
NumebrFormat.getCurrencyInstance();


 Just a guess. You are using a number format without specifying
 the locale. Hence, the default locale for your platform is
 used which propably includes the encoding latin9. The code
 which denotes the euro symbol in latin9 denotes the currency
 symbol in latin1 and (IIRC) in UTF-8. Thus, you see the currency
 symbol, not the expected euro symbol.

 Regards,
 Christian.

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]








-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Problem with Euro symbol

2006-12-04 Thread Jesse Kuhnert

If you get to something more definitive let me know. I should probably
take i18n issues very seriously considering the percentage of
users/developers coming from countries not using english as the
default native language.

On 12/4/06, Ron Piterman [EMAIL PROTECTED] wrote:

not yet - there is no ajax/json involved :(
but I will update and see...

Cheers,
Ron


Jesse Kuhnert wrote:
 Not sure if you were bitten by the same encoding of ajax/json bug that
 others were from this weekends changes but a new release was just
 published that should fix any issues related to that.

 On 12/4/06, Ron Piterman [EMAIL PROTECTED] wrote:

 Thanx, but I am using:

 public Format getCurrencyFormat() {
   Locale l = getPage().getEngine().getLocale();
   return new NumberTranslatorFormat( NumberFormat.getCurrencyInstance( l
 ) );
 }

 the NumberTranslatorFormat is a custom format which devides or
 multiplies the numbers, but is delegating formatting to the given
 CurrencyFormat.

 :(

 Cheers,
 Ron



 Christian Haselbach wrote:
  Zitat von Ron Piterman [EMAIL PROTECTED]:
 
 
 The € is comming from the java currency format object:
 NumebrFormat.getCurrencyInstance();
 
 
  Just a guess. You are using a number format without specifying
  the locale. Hence, the default locale for your platform is
  used which propably includes the encoding latin9. The code
  which denotes the euro symbol in latin9 denotes the currency
  symbol in latin1 and (IIRC) in UTF-8. Thus, you see the currency
  symbol, not the expected euro symbol.
 
  Regards,
  Christian.
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]






-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
Jesse Kuhnert
Tapestry/Dojo team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Re: Problem with Euro symbol

2006-12-04 Thread Sam Gendler

The symbol you are seeing is the symbol used to denote 'locale
specific currency symbol' in a format pattern.  What is strange is
that if you don't have a symbol for that currency in your current
locale, you should get the ISO 3-letter code (EUR, in this case)
rather than a euro symbol.  Is it possible that you are escaping the
currency symbol in your format string, so that the currency symbol
itself is being rendered to the output, rather than having it replaced
by the correct currency within the formatter?

The only other thought I have is that you are telling your browser
that the file is UTF-8 via the meta header, but you may well not have
told Tapestry to spit out UTF-8 characters, resulting in the browser
rendering the generic currency symbol. Putting the meta
http-equiv=Content-Type content=text/html;charset=UTF-8/ line in
the template is not the only thing necessary to get your documents in
UTF-8 correctly. That just tells the browsewr what to expect. Tapestry
will use the default charset of the JVM when reading and writing to
streams, so if your default charset is not a superset of UTF-8, you
could easily wind up with characters that don't translate correctly.
You can discover your default charset by simply printing
Charset.defaultCharset() to your logs.  If you aren't running in
UTF-8, try telling the JVM that is running Tapestry to use UTF-8.  You
can only change the default charset at startup.  Add
-Dfile.encoding=UTF-8 to your JAVA_OPTS var before running tomcat.
That will cause all templates and properties values to be rendered to
the client as UTF-8.

And yes, please let's take i18n very seriously as it is rare for me to
have to develop apps that aren't translated into several different
languages and charsets (cyrillic being the usual culprit when it comes
to problems)

--sam

On 12/4/06, Jesse Kuhnert [EMAIL PROTECTED] wrote:

If you get to something more definitive let me know. I should probably
take i18n issues very seriously considering the percentage of
users/developers coming from countries not using english as the
default native language.

On 12/4/06, Ron Piterman [EMAIL PROTECTED] wrote:
 not yet - there is no ajax/json involved :(
 but I will update and see...

 Cheers,
 Ron


 Jesse Kuhnert wrote:
  Not sure if you were bitten by the same encoding of ajax/json bug that
  others were from this weekends changes but a new release was just
  published that should fix any issues related to that.
 
  On 12/4/06, Ron Piterman [EMAIL PROTECTED] wrote:
 
  Thanx, but I am using:
 
  public Format getCurrencyFormat() {
Locale l = getPage().getEngine().getLocale();
return new NumberTranslatorFormat( NumberFormat.getCurrencyInstance( l
  ) );
  }
 
  the NumberTranslatorFormat is a custom format which devides or
  multiplies the numbers, but is delegating formatting to the given
  CurrencyFormat.
 
  :(
 
  Cheers,
  Ron
 
 
 
  Christian Haselbach wrote:
   Zitat von Ron Piterman [EMAIL PROTECTED]:
  
  
  The € is comming from the java currency format object:
  NumebrFormat.getCurrencyInstance();
  
  
   Just a guess. You are using a number format without specifying
   the locale. Hence, the default locale for your platform is
   used which propably includes the encoding latin9. The code
   which denotes the euro symbol in latin9 denotes the currency
   symbol in latin1 and (IIRC) in UTF-8. Thus, you see the currency
   symbol, not the expected euro symbol.
  
   Regards,
   Christian.
  
   -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
  
  
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




--
Jesse Kuhnert
Tapestry/Dojo team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]