Drew thanks for the reply.
I tried changing the file encoding to UTF-8 and I still don't get the Euro
Basically I am creating a form like this
</td></tr>
<tr>
<td>
Message: <input type="text" name="msg" size="80" value="special chars � � �
� � � � - euro symbol (EUR) - British pound �" maxlength="2000">
</td></tr>
<tr><td>
Then when the form is submitted I print it back out to the JSP itself first
with HTML and a system..out.println.
In the HTML all characters print correctln.. in the system.out The Euro
does not print.
We are running on a Solaris box with Weblogic and Tomat and my Browser is on
a Windows NT machine (In US, Ca) . Actualy when I changed to UTF-8 the
characters came out as Chineese characters.. Without the file encoding the
system.outs would come up as all ?'s with it as UTF-8 they are all wrong.
I got this from View Page Info
Form 1:
Action URL: http://columbus/AmailTest.jsp
Encoding: application/x-www-form-urlencoded (default)
Method: Get
Form 2:
Action URL: http://columbus/AmailTest.jsp
Encoding: application/x-www-form-urlencoded (default)
Method: Get
File MIME Type:
text/html
Source:
Currently in disk cache
Local cache file:
M0DB68LH.JSP
Last Modified:
Unknown
Last Modified:
Unknown
Content Length:
17288
Expires:
No date given
Charset:
UTF-8
Security:
This is an insecure document that is not encrypted and
offers no security protection
Thanks again for Replying.. I am really stuck
-----Original Message-----
From: Drew Sudell [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 15, 2002 3:33 PM
To: Tomcat Users List
Subject: Tomcat and Java Locale
Nance, Michael writes:
> I am trying to solve a problem we are having with Non-ASCII characters
and
> the Euro.
>
> First I am starting tomcat with -Dfile.encoding=ISO8859-1 in out java
> startup.
>
> However if I do something like this
>
> Locale localeTest = new Locale("de","de", "Euro");
> NumberFormat nfTest = NumberFormat.getCurrencyInstance(localeTest);
> <tr>
> <td>Test</td>
> <td><%=nfTest.format(55555)%></td>
> </tr>
> </table>
>
>
> I get his result from My Jsp
> Test
> ? 55.555,00
> I do do a system.out of non Asii Characters such as � � � � � � � -
euro
> symbol (EUR) - British pound �
> and All print except for the Euro (EUR) but if I echo it to the browser
it
> prints fine.
> We are on Unix Boxes with Solaris 7
>
> Is there something else I am missing....
>
Well for one, there is no Euro in ISO 8859-1. The major difference
between Latin 1 (8859-1) and Latin 9 (8859-15) aka Latin 0 is that the
latter has a Euro were the Universal Currency Symbol is in Latin 1 (0xA4).
You mention that the Euro prints fine when you "echo it to the browser".
I'm not sure what that means, but how do you echo it and is the
browser running on a windows box by any chance? The western encoding
on windows is not exactly Latin anything. It's CP1252, which is
Latin1, with some extra characters in the second control set from 0x80
to 0x9F. Guess where they stuck the Euro? Yep somewhere everyone
else expects a control character (0x80). No reasonable software
running on Solaris will think that's a Euro, or even printable. But
if you shove the bits back to a Windows box, you'll see a Euro.
A good rundown of ISO 8859 is at
http://czyborra.com/charsets/iso8859.html
You might try using 8859-15, or perhaps cp1252 if you are only
supporting browsers on windows. Note you'll need to update the
content type in the page directive of the JSP. By default it's 8859-1
and all character data is transcoded to that. In which case I'd
expect you to get '?'s instead of Euros. Since you're getting the
Currency Symbol from the system, I'd expect you to be getting a proper
UCS2 Euro (\u20ac) in any case -- ie I suspect the default file
encoding doesn't make a difference. But the encoding of the JSP
output sure will.
Another strategy is to output UTF-8. Again, the trick is likely to be
setting the JSP encoding/content-type.
If that doesn't work. Let me know
o what you do see when use the above example
o what the content type in the page directive is (if any)
o what environment/locale you are viewing this in (ie where is the
browser)
o what the browser thinks it got back (eg what encoding is it trying
to display, what did it think the content type was. for netscape
do View-Page Info. Not quite sure how to get the content type
in IE)
--
Drew Sudell [EMAIL PROTECTED] http://www.op.net/~asudell
--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>