Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
java unicode: '?' instead of desired characters [SOLVED]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
kristoczaj
Apprentice
Apprentice


Joined: 18 Apr 2004
Posts: 199
Location: Poland

PostPosted: Mon Jul 04, 2005 12:04 pm    Post subject: java unicode: '?' instead of desired characters [SOLVED] Reply with quote

This example shows my problem:
call to method from JFrame:
Code:
setTitle( "\u0119\u0105\u015b\u0142\u017c\u017a\u0107\u0144 \u0118\u0104\u015a\u0141\u017b\u0179\u0106\u0143" ) ;

sets the window title to a set of '?' (questionmarks), instead of desired unicode characters.. Does anyone know what should I do to be able to see the real characters?
Here's some info:
Code:
~ $ java -version
java version "1.4.2-02"
Java(TM) 2 Runtime Environment, Standard Edition (build Blackdown-1.4.2-02)
Java HotSpot(TM) Client VM (build Blackdown-1.4.2-02, mixed mode)

I use eclipse, default configuration. I have unicode in my useflags. My locale is ( "pl", "PL" ) and that i set at the beginning of the java program.
Does anyone know why my java doesn't show the characters? My idea is that it might be a font problem, but I don't know what to do with it..
Regards


Last edited by kristoczaj on Wed Jul 06, 2005 4:20 pm; edited 1 time in total
Back to top
View user's profile Send private message
frostschutz
Advocate
Advocate


Joined: 22 Feb 2005
Posts: 2194
Location: Germany

PostPosted: Mon Jul 04, 2005 12:42 pm    Post subject: Reply with quote

It's probably the just the font that java is using. At least that was the fault on my system. I replaced the Java fonts with some other font that had all characters I needed. As for how to change the font, I did it the dirty way, replacing the fonts in /opt/blackdown-jdk-1.4.2.02/jre/lib/fonts/ with symlinks to the font I wanted, because I couldn't figure out how to do it right.
Back to top
View user's profile Send private message
kristoczaj
Apprentice
Apprentice


Joined: 18 Apr 2004
Posts: 199
Location: Poland

PostPosted: Mon Jul 04, 2005 8:43 pm    Post subject: Reply with quote

Thanks, I'll try playing with fonts.. Meanwhile maybe someone who knows more about fonts in java can give me a hint?
Back to top
View user's profile Send private message
kristoczaj
Apprentice
Apprentice


Joined: 18 Apr 2004
Posts: 199
Location: Poland

PostPosted: Wed Jul 06, 2005 4:19 pm    Post subject: Reply with quote

OK, I figured it out: the title of the main window used a system font instead of a java font, and that system font didn't have characters that I wanted.
Code:
      JFrame.setDefaultLookAndFeelDecorated( true ) ;

This fixed it, because it caused the window title to use java fonts. It also changed the look of the window (like it should), but that doesn't bother me.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum