• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Java, Unicode, and supplementary characters question

 
Ranch Hand
Posts: 383
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, I have code like this:

It contains 4 code units: the first and the last areo some Asian chars (found it on the web somewhere), ant the 2 inside comprise a supplementary char. The code prints out what expected: 4 units, 3 points. What I am curious about is that when I display it using Swing, it prints the Asian chars correctly, but it fails for the supplementary char, printing just an empty box. It is no surprise that System.out prints ??? to the console (Vista Home Premium), but why is the middle character not shown correctly? Does it have to do anything with a font not having a glyph for this code point? The code point was taken from here: http://java.sun.com/developer/technicalArticles/Intl/Supplementary/ (scroll a little down, the first table with 4 characters, the last one, kind of an small letter 'a').

Raf
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Raf Szczypiorski wrote:Does it have to do anything with a font not having a glyph for this code point?


Possibly. Which font are you using?
 
Raf Szczypiorski
Ranch Hand
Posts: 383
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hmm, I don't know, how can I check that? I haven't changed anything in the swing configuration in any way.
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm not sure what Swing's default font is, but I'm certain that it doesn't even include all BMP 0 characters, much less anything that's in one of the other BMPs.

Here are fonts that might include those characters: http://www.code2000.net/
 
Every plan is a little cooler if you have a blimp. And a tiny ad.
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic