wood burning stoves*
The moose likes JSP and the fly likes Handling unicode character's in non-unicode browsers Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Handling unicode character Watch "Handling unicode character New topic
Author

Handling unicode character's in non-unicode browsers

Jason Keating
Greenhorn

Joined: Jun 16, 2002
Posts: 12
Hi, I'm a long time lurker, and if memory serves a first time poster. Let me know if I put a foot astray.
I have a question regarding unicode support.
I have several sites using unicode characters, particularly the following.
#257 (macron over a)
#275 (macron over e)
#299 (macron over i)
#333 (macron over o)
#363 (macron over u)
#256 (macron over A)
#274 (macron over E)
#298 (macron over I)
#332 (macron over O)
#362 (macron over U)
Serving up these characters is no problem, but serving up readable alternatives to non-unicode browsers is. When I find a browser which I know does not support unicode characters by default I would like to display the character without a macron.
For example...
for a uni-code browser I would display a #257 (macron over a).
for a non-unicode browser I would display an 'a'.
My content will include unicode chars by default so I plan to replace the unicode chars with non-unicode chars when the occassion arises.
Is anyone able to point me in the right direction? so far I have found many references to provision/enabling of unicode support, but nothing covering extreme cases such this. I thought maybe jsp/servlets which provide internationalised support to WML might be a good place to start but I think its such a rare case that info is scarce.
Thanks in advance.
J
Nicholas Cheung
Ranch Hand

Joined: Nov 07, 2003
Posts: 4982
I think it is not easy to detect whether the browser supports Unicode.
One way we can do is, if we are sure that a certain type of browsers support Unicode, like IE, then, we can perform a JS check, and send the request to the JSP.
When the client 1st send a request to the entry page, we show a blank page, and have an onload() method to check the browser. The method will the submit or redirect the client to the real JSP page, together with the browser type. For example, if the browser is IE, then send the request to support_unicode.jsp. If the browser is, say X which does not support unicode, then send the request to not_support_unicode.jsp.
And your JSP is able to print both unicode and non-unicode characters.
Does this help?
Nick.


SCJP 1.2, OCP 9i DBA, SCWCD 1.3, SCJP 1.4 (SAI), SCJD 1.4, SCWCD 1.4 (Beta), ICED (IBM 287, IBM 484, IBM 486), SCMAD 1.0 (Beta), SCBCD 1.3, ICSD (IBM 288), ICDBA (IBM 700, IBM 701), SCDJWS, ICSD (IBM 348), OCP 10g DBA (Beta), SCJP 5.0 (Beta), SCJA 1.0 (Beta), MCP(70-270), SCBCD 5.0 (Beta), SCJP 6.0, SCEA for JEE5 (in progress)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Handling unicode character's in non-unicode browsers