aspose file tools*
The moose likes Java in General and the fly likes Does anybody know how to print \u2064 and \u2065? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Does anybody know how to print \u2064 and \u2065?" Watch "Does anybody know how to print \u2064 and \u2065?" New topic
Author

Does anybody know how to print \u2064 and \u2065?

Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39888
    
  28
Here I mentioned range subtraction and range restriction operators, which I have since found, as 2a64 and 2a65, which are on this Unicode chart. Only they say anti-restriction, which means the same. I am blowed if I can get it to display anywhere. I even tried putting \u2a64 or %c . . . 0x2a64 into JOptionPane and got little squares. On Gedit and "bash" it appears as a square with 2a64 in.

Anybody know anything about this? Are these new symbols in Unicode? Have they been added since Java6 came out? Anybody know how to display them?
Zandis Murāns
Ranch Hand

Joined: Aug 18, 2009
Posts: 174

That "thing" is called Unicode Escape.

Before use such strings, in most cases, You have to unescape it. Here, I will write down just to remember how do I do such unescaping manually:
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42649
    
  65
Which font are you using? I wouldn't imagine that most common fonts have those; you'll probably have to resort to a special math font.


Ping & DNS - my free Android networking tools app
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39888
    
  28
Thank you very much.

On JOptionPane it would appear to be the usual sans-serif font they use in Java. But I thought that was Unicode compliant; whenever I tried anything else in JOptionPane it has come out nicely. I also have no difficulty getting things like ▷ (\u25b7) to show on "bash".
campbell@*****-laptop:~$ ▷
bash: ▷: command not found
campbell@******-laptop:~$
And I could easily copy and paste to OpenOffice; I tried the following fonts: Nimbus Roman no 9, courier 10-pt, Bitstream Vera Sans, Tarablus, and the ▷ appeared clearly.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42649
    
  65
I don't think there are any fonts that include the full range of Unicode characters - it would be huge! E.g., there's a font from Microsoft -Unicode Arial or some such- that has most of the CJK characters - it's more than 20MB, and probably still doesn't have math symbols.

Googling something like "unicode math fonts" should find appropriate ones. There are also tools that show for all installed fonts which characters are included; for OS X, UnicodeChecker (and UnicodeFontInfo) come to mind.

On my machine, only a font called "Apple Symbols" has the 2a64 and 2a65 characters.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39888
    
  28
The nearest I could find so far was DejaVu fonts. There is somebody working on the range 2a**, so I shall log onto their forum and see if I can put in a request.

Thank you for the help.

C
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18911
    
    8

"bash" in your post suggests that you aren't using Windows, but still, Alan Wood's Unicode Resources might help.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39888
    
  28
Thank you very much, Paul. Caslon appeared promising from that page, but doesn't seem to support my glyphs (and I already had it). I have put in a request on the Deja Vu mailing list.
What's "Windows"?

C
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42649
    
  65
Everson Mono is a shareware font that has these (and many other rarely used) characters: http://www.evertype.com/emono/
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Does anybody know how to print \u2064 and \u2065?