File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes Unicode differences - Win vs Solaris Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Unicode differences - Win vs Solaris" Watch "Unicode differences - Win vs Solaris" New topic

Unicode differences - Win vs Solaris

PJ Crump
Ranch Hand

Joined: Feb 06, 2002
Posts: 51
I developed a webapp on the win 2k version of WAS. Now that I have deployed it on Solaris something wierd is happening. In certain places in the java code I put a unicode 00A0 (no-breaking space) into a string that is to be sent back to the browser (for populating a select box.. long story). Anyway all is good on win2k. When I deploy the app to Solaris the no-breaking space is now a question mark. I know that it has to do w/ the differences between Win and Solaris, but for the life of me I have been unable to locate the unicode value for a non-breaking space for Solaris. Any help would be appreciated.
- PJ
Jim Yingst

Joined: Jan 30, 2000
Posts: 18671
Unicode values are the same everywhere. However (a) not every platform can display every character (though I'd think Unix should have no trouble with nbsb, and (b) you may well be relying on some default encoding scheme other than Unicode which is providing different results here.
Since you're displaying this data in an HTML context, probably the best solution is to replace your non-breaking space with the HTML character entity "&nbsp;". This should represent a non-breaking space, just as "&amp;" represents '&', or "&lt;" represents <.

"I'm not back." - Bill Harding, Twister
I agree. Here's the link:
subject: Unicode differences - Win vs Solaris
It's not a secret anymore!