jQuery in Action, 3rd edition
The moose likes I/O and Streams and the fly likes Encoding - UTF-8 cannot display Extended ASCII Character ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Customer Requirements for Developers this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "Encoding - UTF-8 cannot display Extended ASCII Character ?" Watch "Encoding - UTF-8 cannot display Extended ASCII Character ?" New topic
Author

Encoding - UTF-8 cannot display Extended ASCII Character ?

Nicky Eng
Ranch Hand

Joined: Mar 26, 2005
Posts: 378
I have 2 web application and found one funny case which is in Admin the character display fine but it displays blank/question_mark for the character in User Web.

1 - Admin
2 - User Web

In Admin application, in web.xml encoding is iso-8859-1. and all the JSPs i put this tag:



In UserWeb app, in web.xml encoding is utf-8 and all the JSPs i put this tag:



So the case is, I have this character in DB --> ' (which is chr(146) - extended ascii character)
In admin it retrieve from DB and display the character correctly as in --> '
but it doesn't display correctly in UserWeb.

DB character set is US7ASCII

--------------------
Is above encoding part is the cause of the issue ?
If so, why UTF-8 character encoding cannot somehow accept extended ascii character like chr(146) ?

Anyone got idea ?
I've been stuck for the whole day ...



From NickyEng
Diploma in Computer Studies
SCJP 1.4
SCWCD 1.4
Formula 1 app by Maxis (Playbook)
Stephan van Hulst
Bartender

Joined: Sep 20, 2010
Posts: 3908
    
  18

Are you using the same fonts in both applications to display the character?


The mind is a strange and wonderful thing. I'm not sure that it will ever be able to figure itself out, everything else, maybe. From the atom to the universe, everything, except itself.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Encoding - UTF-8 cannot display Extended ASCII Character ?
 
jQuery in Action, 3rd edition