List Info

Thread: extended ASCII characters not shown properly on JSF page




extended ASCII characters not shown properly on JSF page
user name
2007-10-04 19:38:56
Hi All,

We have an application which supports extended ASCII characters.
For instance characters like: å, ö, Ç, © are a part of content.

I am using myfaces 1.1.5, tomahawk 1.1.5
There are different read only input text fields where content is displayed to the user. Special characters are part of this content.

When the page comes up then the characters are garbled and a rectangular box is shown for any extended character. I believe that the encoding is not happening correctly. Got through the following link which lists down all the HTML escape characters:
http://www.theukwebdesigncompany.com/articles/entity-escape-characters.php

Character: ©  - Proper encoding should be © The value that comes up is � which is rather strange.

I have tried setting the charset of the JSF to both ISO-8859-1 and UTF-8 but things have not changed.

Any help would be greatly appreciated.

Thanks,
Madhav



--
When I tell the truth, it is not for the sake of convincing those who do not know it, but for the sake of defending those that do
Re: extended ASCII characters not shown properly on JSF page
user name
2007-10-05 05:57:01
Hi,

the "entity escape" of a character depends on
encoding used. The 
� is probably the UTF-8 encoding of copyright
character. Rule is: 
convert character to binary form using the choosen encoding,
then write 
down that value after &#. Your link references looks
like using either 
sio8859-1 or cp850 :s

Considering now JSf is outputing as utf-8, just ensure your
page header 
does not contain a jsp instruction telling page is iso8859-1
as it will 
be contradictory. Check also you don't have a head section
on your 
rendered page with a <meta> specifying content
encoding. Let the server 
(tomcat) set the content encoding as part of http
"content-type" header, 
which matches the output encoding used by jsf
ResponseWriter.


Madhav Bhargava a écrit :
> Hi All,
>
> We have an application which supports extended ASCII
characters.
> For instance characters like: å, ö, Ç, © are a part of
content.
>
> I am using myfaces 1.1.5, tomahawk 1.1.5
> There are different read only input text fields where
content is 
> displayed to the user. Special characters are part of
this content.
>
> When the page comes up then the characters are garbled
and a 
> rectangular box is shown for any extended character. I
believe that 
> the encoding is not happening correctly. Got through
the following 
> link which lists down all the HTML escape characters:
> http://www.theukwebdesigncompany.com/a
rticles/entity-escape-characters.php
>
> Character: ©  - Proper encoding should be &#169;
The value that comes 
> up is &#65533; which is rather strange.
>
> I have tried setting the charset of the JSF to both
ISO-8859-1 and 
> UTF-8 but things have not changed.
>
> Any help would be greatly appreciated.
>
> Thanks,
> Madhav
>
>
>
> -- 
> When I tell the truth, it is not for the sake of
convincing those who 
> do not know it, but for the sake of defending those
that do 


[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )