You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by balaraju mandala <ba...@gmail.com> on 2006/07/17 08:55:56 UTC

getting "?" instead of "¢"

Hi All,

I need some help from you. I need to display Cent(¢) symbol on browser. I am
getting ? symbol instead, what could be the problem, please explain me.

Thank you.

balaraju

Re: getting "?" instead of "¢"

Posted by David Delbecq <da...@oma.be>.
http://htmlhelp.com/reference/html40/entities/latin1.html

balaraju mandala wrote:
> Hi All,
>
> I need some help from you. I need to display Cent(¢) symbol on
> browser. I am
> getting ? symbol instead, what could be the problem, please explain me.
>
> Thank you.
>
> balaraju
>


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: getting "?" instead of "¢"

Posted by Markus Schönhaber <ma...@schoenhaber.de>.
Markus Schönhaber wrote:
> contains all symbols used is enough. This mail for example should use
> ISO-8859-1 as charset and still contain the literal cent sign above
> correctly encoded.

Wrong. My mail client chose to encode it in UTF-8. But that doesn't change the 
fact that ISO-8859-1 contains the ¢ sign at position 162.

Regards
  mks

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: getting "?" instead of "¢"

Posted by Markus Schönhaber <ma...@schoenhaber.de>.
David Delbecq wrote:
> This is not a matter of saving the jsp/html file on server with the good
> charset, 

It is.

> this is a matter of using the correct entity reference (&cent;) 
> which is supposed to be displayable by any html 2.0 compliant browser.

Using an entity reference is just one way to get "special" characters 
transmitted to the client. But this will only work if this entity reference 
is defined/recocgnized/interpreted in the output format used - for example in 
HTML. For other output formats - for example plain text - this will obviously 
be useless.
Since - in my experience - modern clients on modern OSes can handle correctly 
encoded input just fine (if they are told how it's encoded), I see no general 
need to cope with entity references. It all boils down to the fact that the 
encoding declared in the HTTP header and the encoding actually used have to 
match.

So I'd also stick with Ronald's proposal and create correctly encoded output.

The following - if saved as UTF-8 - should work as expected:

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Display a cent</title>
</head>
<body>
<p>These are two cents: ¢ &cent;
</body>
</html>

BTW: it isn't strictly neccessary to use UTF-8. Using a charset that contains 
all symbols used is enough. This mail for example should use ISO-8859-1 as 
charset and still contain the literal cent sign above correctly encoded.
Nevertheless I'd prefer UTF-8 on the web as a more universal approach.

Regards
  mks

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: getting "?" instead of "¢"

Posted by David Delbecq <da...@oma.be>.
(Sorry for the double post, alias issue)
David Delbecq wrote:
> This is not a matter of saving the jsp/html file on server with the good
> charset, this is a matter of using the correct entity reference (&cent;)
> which is supposed to be displayable by any html 2.0 compliant browser.
> Ronald Klop wrote:
>> On Mon Jul 17 08:55:56 CEST 2006 Tomcat Users List 
>> <us...@tomcat.apache.org> wrote:
>>> Hi All,
>>>
>>> I need some help from you. I need to display Cent(¢) symbol on 
>>> browser. I am
>>> getting ? symbol instead, what could be the problem, please explain me.
>>>
>>> Thank you.
>>>
>>> balaraju
>> Hello,
>>
>> Use the method ServletResponse.setCharacterEncoding("UTF-8") in a 
>> Servlet or contentType="text/html; charset=UTF-8" in a jsp page.
>> http://java.sun.com/products/jsp/syntax/1.2/syntaxref1210.html#15653
>>
>> But charset issues are tricky because all you files need to use a 
>> known charset. And if you use a database it needs to have a supported 
>> charset also.
>> If your editor saves files in iso-8859-1 the problem is already there 
>> and the browser wil never see the right character. So you need to 
>> debug where the character is correct for the last time.
>>
>> Ronald.
>>
>>
>
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: getting "?" instead of "¢"

Posted by David Delbecq <da...@oma.be>.
This is not a matter of saving the jsp/html file on server with the good
charset, this is a matter of using the correct entity reference (&cent;)
which is supposed to be displayable by any html 2.0 compliant browser.
Ronald Klop wrote:
> On Mon Jul 17 08:55:56 CEST 2006 Tomcat Users List 
> <us...@tomcat.apache.org> wrote:
>> Hi All,
>>
>> I need some help from you. I need to display Cent(¢) symbol on 
>> browser. I am
>> getting ? symbol instead, what could be the problem, please explain me.
>>
>> Thank you.
>>
>> balaraju
> Hello,
>
> Use the method ServletResponse.setCharacterEncoding("UTF-8") in a 
> Servlet or contentType="text/html; charset=UTF-8" in a jsp page.
> http://java.sun.com/products/jsp/syntax/1.2/syntaxref1210.html#15653
>
> But charset issues are tricky because all you files need to use a 
> known charset. And if you use a database it needs to have a supported 
> charset also.
> If your editor saves files in iso-8859-1 the problem is already there 
> and the browser wil never see the right character. So you need to 
> debug where the character is correct for the last time.
>
> Ronald.
>
>



---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: getting "?" instead of "¢"

Posted by Ronald Klop <ro...@base.nl>.
On Mon Jul 17 12:16:00 CEST 2006 Tomcat Users List <us...@tomcat.apache.org> wrote:
> This is not a matter of saving the jsp/html file on server with the good 
> charset, this is a matter of using the correct entity reference (&cent;) 
> which is supposed to be displayable by any html 2.0 compliant browser.
 There are more possibilities for the same thing. In the original question there is no mention about where the character is coming from. If it is something an user submits in a form and is stored in the database and then displayed in another webpage you can not asume the user to type &cent;.

Ronald.
>  Ronald Klop wrote:
> > On Mon Jul 17 08:55:56 CEST 2006 Tomcat Users List 
> > <us...@tomcat.apache.org> wrote:
> >> Hi All,
> >>
> >> I need some help from you. I need to display Cent(¢) symbol on 
> >> browser. I am
> >> getting ? symbol instead, what could be the problem, please explain me.
> >>
> >> Thank you.
> >>
> >> balaraju
> > Hello,
> >
> > Use the method ServletResponse.setCharacterEncoding("UTF-8") in a 
> > Servlet or contentType="text/html; charset=UTF-8" in a jsp page.
> > http://java.sun.com/products/jsp/syntax/1.2/syntaxref1210.html#15653
> >
> > But charset issues are tricky because all you files need to use a 
> > known charset. And if you use a database it needs to have a supported 
> > charset also.
> > If your editor saves files in iso-8859-1 the problem is already there 
> > and the browser wil never see the right character. So you need to 
> > debug where the character is correct for the last time.
> >
> > Ronald.
> >
> >
> 
> 
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 

Re: getting "?" instead of "¢"

Posted by David Delbecq <de...@oma.be>.
This is not a matter of saving the jsp/html file on server with the good 
charset, this is a matter of using the correct entity reference (&cent;) 
which is supposed to be displayable by any html 2.0 compliant browser.
Ronald Klop wrote:
> On Mon Jul 17 08:55:56 CEST 2006 Tomcat Users List 
> <us...@tomcat.apache.org> wrote:
>> Hi All,
>>
>> I need some help from you. I need to display Cent(¢) symbol on 
>> browser. I am
>> getting ? symbol instead, what could be the problem, please explain me.
>>
>> Thank you.
>>
>> balaraju
> Hello,
>
> Use the method ServletResponse.setCharacterEncoding("UTF-8") in a 
> Servlet or contentType="text/html; charset=UTF-8" in a jsp page.
> http://java.sun.com/products/jsp/syntax/1.2/syntaxref1210.html#15653
>
> But charset issues are tricky because all you files need to use a 
> known charset. And if you use a database it needs to have a supported 
> charset also.
> If your editor saves files in iso-8859-1 the problem is already there 
> and the browser wil never see the right character. So you need to 
> debug where the character is correct for the last time.
>
> Ronald.
>
>


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: getting "?" instead of "¢"

Posted by Martin Gainty <mg...@hotmail.com>.
Assuming you have this Character Set declaration in your html head
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

use 
U+00A2
http://www.alanwood.net/unicode/latin_1_supplement.html

HTH
Martin--
*********************************************************************
This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed.  If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.



----- Original Message ----- 
From: "Ronald Klop" <ro...@base.nl>
To: "Tomcat Users List" <us...@tomcat.apache.org>
Cc: "balaraju mandala" <ba...@gmail.com>
Sent: Monday, July 17, 2006 5:57 AM
Subject: Re: getting "?" instead of "¢"


On Mon Jul 17 08:55:56 CEST 2006 Tomcat Users List <us...@tomcat.apache.org> wrote:
> Hi All,
> 
> I need some help from you. I need to display Cent(¢) symbol on browser. I am
> getting ? symbol instead, what could be the problem, please explain me.
> 
> Thank you.
> 
> balaraju
Hello,

Use the method ServletResponse.setCharacterEncoding("UTF-8") in a Servlet or contentType="text/html; charset=UTF-8" in a jsp page.
http://java.sun.com/products/jsp/syntax/1.2/syntaxref1210.html#15653

But charset issues are tricky because all you files need to use a known charset. And if you use a database it needs to have a supported charset also.
If your editor saves files in iso-8859-1 the problem is already there and the browser wil never see the right character. So you need to debug where the character is correct for the last time.

Ronald.


Re: getting "?" instead of "¢"

Posted by Ronald Klop <ro...@base.nl>.
On Mon Jul 17 08:55:56 CEST 2006 Tomcat Users List <us...@tomcat.apache.org> wrote:
> Hi All,
> 
> I need some help from you. I need to display Cent(¢) symbol on browser. I am
> getting ? symbol instead, what could be the problem, please explain me.
> 
> Thank you.
> 
> balaraju
Hello,

Use the method ServletResponse.setCharacterEncoding("UTF-8") in a Servlet or contentType="text/html; charset=UTF-8" in a jsp page.
http://java.sun.com/products/jsp/syntax/1.2/syntaxref1210.html#15653

But charset issues are tricky because all you files need to use a known charset. And if you use a database it needs to have a supported charset also.
If your editor saves files in iso-8859-1 the problem is already there and the browser wil never see the right character. So you need to debug where the character is correct for the last time.

Ronald.