f



problem with java displaying unicode, under ms-windows

Hi folks,
I'm hoping someone can tell me the magic to get java (6 or 7) to display unicode chars under ms-windows?

This is a standalone program, not an applet:

http://bolthole.com/jdrill/jdrill2_3_1.jar

The program itself works; I know this, because it displays fine under macos.
Unfortunately, the exact same jar file displays empty boxes instead of nice kanji chars, under ms-windows. Using java version 6 or 7.

Looking in the font properties type files, it seems like they are referencing ms-gothic and ms-mincho fonts. which ARE present on the system.
I see ms-gothic and ms-mincho in Control panel->fonts
And my browser successfully displays unicode pages such as
http://www.mainichi.co.jp/

So... why isnt java displaying unicode properly???

Some years ago, it was neccessary to download a special "international" version of java on windows, to display 16-bit-wide fonts.
but there does not even seem to be that option any more.
So.. what should I do?

0
phil178 (84)
7/22/2012 5:31:30 AM
comp.lang.java.programmer 52714 articles. 1 followers. Post Follow

14 Replies
1059 Views

Similar Articles

[PageSpeed] 2

hil@bolthole.com wrote:
> I'm hoping someone can tell me the magic to get java [sic] (6 or 7) to display unicode [sic] chars under ms-windows [sic]?

This is really an OS question.

Java will emit characters using the target OS's encoding by default.

The fact is that Java is already displaying Unicode characters. However it is 
Windows that is failing to render them.

Do you set the encoding explicitly in your program.

> This is a standalone program, not an applet:
>
> http://bolthole.com/jdrill/jdrill2_3_1.jar
>
> The program itself works; I know this, because it displays fine under macos.
> Unfortunately, the exact same jar file displays empty boxes instead of nice kanji chars, under ms-windows. Using java version 6 or 7.
>
> Looking in the font properties type files, it seems like they are referencing ms-gothic and ms-mincho fonts. which ARE present on the system.
> I see ms-gothic and ms-mincho in Control panel->fonts
> And my browser successfully displays unicode pages such as
> http://www.mainichi.co.jp/
>
> So... why isnt java displaying unicode properly???
>
> Some years ago, it was neccessary to download a special "international" version of java on windows, to display 16-bit-wide fonts.
> but there does not even seem to be that option any more.
> So.. what should I do?

See if specifying the encoding in your output commands helps.

-- 
Lew
Honi soit qui mal y pense.
http://upload.wikimedia.org/wikipedia/commons/c/cf/Friz.jpg
0
noone7 (4050)
7/22/2012 6:48:16 AM
On Sat, 21 Jul 2012 22:31:30 -0700 (PDT), phil@bolthole.com wrote:

>Hi folks,
>I'm hoping someone can tell me the magic to get java (6 or 7) to display unicode chars under ms-windows?
>
>This is a standalone program, not an applet:
>
>http://bolthole.com/jdrill/jdrill2_3_1.jar
>
>The program itself works; I know this, because it displays fine under macos.
>Unfortunately, the exact same jar file displays empty boxes instead of nice kanji chars, under ms-windows. Using java version 6 or 7.
>
>Looking in the font properties type files, it seems like they are referencing ms-gothic and ms-mincho fonts. which ARE present on the system.
>I see ms-gothic and ms-mincho in Control panel->fonts
>And my browser successfully displays unicode pages such as
>http://www.mainichi.co.jp/
>
>So... why isnt java displaying unicode properly???
>
>Some years ago, it was neccessary to download a special "international" version of java on windows, to display 16-bit-wide fonts.
>but there does not even seem to be that option any more.
>So.. what should I do?
Does your Windows font have those kanji characters available?  The box
character is a replacement for "I do not have this character available
in the font you specify so I will show this box instead".  Try
changing your Windows font to one which includes the required kanji
characters.

rossum

0
rossum48 (719)
7/22/2012 11:53:31 AM
On Saturday, July 21, 2012 11:48:16 PM UTC-7, Lew wrote:
> Philip Brown wrote:
> > I'm hoping someone can tell me the magic to get java [sic] (6 or 7) to display unicode [sic] chars under ms-windows [sic]?
> 
> This is really an OS question.
> 
> Java will emit characters using the target OS's encoding by default.
> 
> The fact is that Java is already displaying Unicode characters. However it is 
> Windows that is failing to render them.
> 
> Do you set the encoding explicitly in your program.

I think I did.
If I didnt, wouldnt it fail under macos?

It works under macos, as I said.

Similarly, if I failed to set the encoding properly... wouldnt it just display gibberish chars?

Instead, its displaying the old empty square "no font mapping for this char" glyph.

Similarly.. when it attempts to display a char, it is displaying ONE empty-square.
If the encoding was not set, it would display two empty chars, since it's displaying a 2-byte "widechar"

Not to mention that the same program has worked under earlier versions of windows and jre.
(And by "same program", I mean *same* program)

0
phil178 (84)
7/22/2012 12:00:26 PM
On Sunday, July 22, 2012 4:53:31 AM UTC-7, rossum wrote:
> >http://bolthole.com/jdrill/jdrill2_3_1.jar
> >
> >The program itself works; I know this, because it displays fine under=
 macos.
> >Unfortunately, the exact same jar file displays empty boxes instead o=
f nice kanji chars, under ms-windows. Using java version 6 or 7.
>...
> Does your Windows font have those kanji characters available?  The box
> character is a replacement for "I do not have this character availab=
le
> in the font you specify so I will show this box instead".  Try
> changing your Windows font to one which includes the required kanji
> characters.
>=20

That's what I'm trying to do: have the jre change which font it uses for th=
e unicode->local font mapping.
Unfortunately, there are no directions for this. And even me poking around =
behind the scenes, suggests that it already should be doing the "correct" m=
apping. The default seems like it should be using the already-installed fon=
ts.

Except it isnt.

Could someone who knows about these things, and is currently running ms-win=
dows, please take a moment to download the program and verify that java on =
windows isnt working right, and how to fix it?

It works out of the box in macos.
It works out of the box in solaris.
Therefore, seems like my program is fine, but there's something wrong with =
the java 7 setup on ms-windows.

Contrariwise, if you still think it's my program that is broken: please pro=
vide a java program that I can freely download and run, that will show unic=
ode chars in a GUI window. I havent found any third party test cases, which=
 is why a long time ago, I wrote my own trivial little unicode GUI tester c=
lass.
( http://www.bolthole.com/java/unicode)

All the examples for "java unicode" I've found, merely use System.out.print=
ln().  Not what is needed here!!

0
phil178 (84)
7/22/2012 12:47:21 PM
On 7/22/2012 5:47 AM, Philip Brown wrote:

> Could someone who knows about these things, and is currently running
> ms-windows, please take a moment to download the program and verify


I don't download code, as a rule.  Can you produce a simple, short, 
complete, compilable example that prints a few characters from the range 
you are interested in, and post the source here?  That I will look at.


> Contrariwise, if you still think it's my program that is broken:
> please provide a java program that I can freely download and run,


This works for me:

package quicktest;

import javax.swing.JFrame;
import javax.swing.JTextArea;
import javax.swing.SwingUtilities;

/**
  *
  * @author Brenden
  */
public class UpperCodepoint {

    public static void main(String[] args) {
       SwingUtilities.invokeLater(new Runnable() {
          public void run() {
             StringBuilder stb = new StringBuilder();
             stb.appendCodePoint(0x20FF0);
             JFrame frame = new JFrame();
             JTextArea ta = new JTextArea();
             frame.add(ta);
             ta.setText(stb.toString());

             frame.pack();
             frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
             frame.setLocationRelativeTo(null);
             frame.setSize(500, 500);
             frame.setVisible(true);
          }
       });

    }
}
0
markspace
7/22/2012 3:46:27 PM
On 7/21/2012 10:31 PM, phil@bolthole.com wrote:
> Hi folks,
> I'm hoping someone can tell me the magic to get java (6 or 7) to display unicode chars under ms-windows?
>
> This is a standalone program, not an applet:
>
> http://bolthole.com/jdrill/jdrill2_3_1.jar
>
> The program itself works; I know this, because it displays fine under macos.
> Unfortunately, the exact same jar file displays empty boxes instead of nice kanji chars, under ms-windows. Using java version 6 or 7.
>
> Looking in the font properties type files, it seems like they are referencing ms-gothic and ms-mincho fonts. which ARE present on the system.
> I see ms-gothic and ms-mincho in Control panel->fonts
> And my browser successfully displays unicode pages such as
> http://www.mainichi.co.jp/
>
> So... why isnt java displaying unicode properly???
>
> Some years ago, it was neccessary to download a special "international" version of java on windows, to display 16-bit-wide fonts.
> but there does not even seem to be that option any more.
> So.. what should I do?
>

I copied some text from www.mainichi.co.jp into Libre Office.  I saved 
the text as UTF-8.  I used the program below to display it.  It isn't 
quite correct though, I get a dot before the text that wasn't on the web 
page.  Other than that it works fine.

import java.awt.*;
import java.awt.event.*;
import java.io.*;
import java.nio.charset.*;
import javax.swing.*;

public class test extends JPanel {
     private char[] buffer = new char[256];
     private int n;

     public test() {
         setPreferredSize(new Dimension(320,240));
         try {
             FileInputStream fis = new FileInputStream("xxx");
             InputStreamReader isr = new InputStreamReader(fis,"UTF-8");
             n = isr.read(buffer,0,256);
             isr.close();
         } catch (IOException ioe) {
             ioe.printStackTrace();
         }
     }

     public void paintComponent(Graphics g) {
         g.setFont(new Font("MS Mincho",Font.PLAIN,12));
         g.drawChars(buffer,0,n,10,20);
     }

     public static void main(String[] args) {
         EventQueue.invokeLater(new Runnable() {
             public void run() {
                 JFrame f = new JFrame();
                 f.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
                 f.add(new test(),BorderLayout.CENTER);
                 f.pack();
                 f.setVisible(true);
             }
         });
     }
}


0
nospam8071 (1252)
7/22/2012 4:22:52 PM
On Sunday, July 22, 2012 9:22:52 AM UTC-7, Knute Johnson wrote:
> ....
> I copied some text from www.mainichi.co.jp into Libre Office.  I saved 
> the text as UTF-8.  I used the program below to display it.  It isn't 
> quite correct though, I get a dot before the text that wasn't on the web 
> page.  Other than that it works fine.
 

Interesting.  But it breaks the concept of "write once run anywhere", to set a platform specific font. My issue centers on how to make it work WITHOUT that hack.
As I mentioned, my program currently runs fine on MacOS, Solaris, linux, .....
I dont want any OS-specific code in my program (nor should I have to have any?!)

btw: thanks to markspace for his code, but I'm using AWT.
Kindasorta like Knute's code, but with plain Frame, not JFrame, as top.


On Sunday, July 22, 2012 9:22:52 AM UTC-7, Knute Johnson wrote:
> On 7/21/2012 10:31 PM, phil@bolthole.com wrote:
> > Hi folks,
> > I'm hoping someone can tell me the magic to get java (6 or 7) to display unicode chars under ms-windows?
> >
> > This is a standalone program, not an applet:
> >
> > http://bolthole.com/jdrill/jdrill2_3_1.jar
> >
> > The program itself works; I know this, because it displays fine under macos.
> > Unfortunately, the exact same jar file displays empty boxes instead of nice kanji chars, under ms-windows. Using java version 6 or 7.
> >
> > Looking in the font properties type files, it seems like they are referencing ms-gothic and ms-mincho fonts. which ARE present on the system.
> > I see ms-gothic and ms-mincho in Control panel->fonts
> > And my browser successfully displays unicode pages such as
> > http://www.mainichi.co.jp/
> >
> > So... why isnt java displaying unicode properly???
> >
> > Some years ago, it was neccessary to download a special "international" version of java on windows, to display 16-bit-wide fonts.
> > but there does not even seem to be that option any more.
> > So.. what should I do?
> >
> 
> I copied some text from www.mainichi.co.jp into Libre Office.  I saved 
> the text as UTF-8.  I used the program below to display it.  It isn't 
> quite correct though, I get a dot before the text that wasn't on the web 
> page.  Other than that it works fine.
> 
> import java.awt.*;
> import java.awt.event.*;
> import java.io.*;
> import java.nio.charset.*;
> import javax.swing.*;
> 
> public class test extends JPanel {
>      private char[] buffer = new char[256];
>      private int n;
> 
>      public test() {
>          setPreferredSize(new Dimension(320,240));
>          try {
>              FileInputStream fis = new FileInputStream("xxx");
>              InputStreamReader isr = new InputStreamReader(fis,"UTF-8");
>              n = isr.read(buffer,0,256);
>              isr.close();
>          } catch (IOException ioe) {
>              ioe.printStackTrace();
>          }
>      }
> 
>      public void paintComponent(Graphics g) {
>          g.setFont(new Font("MS Mincho",Font.PLAIN,12));
>          g.drawChars(buffer,0,n,10,20);
>      }
> 
>      public static void main(String[] args) {
>          EventQueue.invokeLater(new Runnable() {
>              public void run() {
>                  JFrame f = new JFrame();
>                  f.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
>                  f.add(new test(),BorderLayout.CENTER);
>                  f.pack();
>                  f.setVisible(true);
>              }
>          });
>      }
> }

0
phil178 (84)
7/22/2012 4:55:51 PM
On 7/22/2012 9:55 AM, Philip Brown wrote:
> btw: thanks to markspace for his code, but I'm using AWT.
> Kindasorta like Knute's code, but with plain Frame, not JFrame, as top.


It works the same for AWT.  They all use the same drawChars() method 
underneath.


0
markspace
7/22/2012 5:10:28 PM
On Sunday, July 22, 2012 10:10:28 AM UTC-7, markspace wrote:
> On 7/22/2012 9:55 AM, Philip Brown wrote:
> > btw: thanks to markspace for his code, but I'm using AWT.
> > Kindasorta like Knute's code, but with plain Frame, not JFrame, as top.
> 
> 
> It works the same for AWT.  They all use the same drawChars() method 
> underneath.

Yeah, I figured.
The good news is, I found a solution to get the JRE working properly in windows, so it can work as well as MacOS.


step 1: copy (jre)/lib/fontconfig.properties.src to fontconfig.properties
step 2: modify the line

sequence.allfonts=alphabetic/default,dingbats,symbol

to be
sequence.allfonts=alphabetic/default,dingbats,symbol,japanese

The odd thing is,the MacOS fontconfig.properties, is not set up that way. But It Works.  Oh well.
0
phil178 (84)
7/22/2012 5:37:13 PM
On 7/22/2012 10:37 AM, Philip Brown wrote:

> step 1: copy (jre)/lib/fontconfig.properties.src to
> fontconfig.properties step 2: modify the line
>
> sequence.allfonts=alphabetic/default,dingbats,symbol
>
> to be sequence.allfonts=alphabetic/default,dingbats,symbol,japanese


Thanks for reporting your solution back to us, it helps out everyone. 
However I'm concerned that you may have, or have now, a defective 
installation.  Here's my file;  there's already a different line for 
Japanese script set.  Is your file very different from mine?


#
#
# Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights 
reserved.
# ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#

# Version

version=1

# Component Font Mappings

allfonts.chinese-ms936=SimSun
allfonts.chinese-ms936-extb=SimSun-ExtB
allfonts.chinese-gb18030=SimSun-18030
allfonts.chinese-gb18030-extb=SimSun-ExtB
allfonts.chinese-hkscs=MingLiU_HKSCS
allfonts.chinese-ms950-extb=MingLiU-ExtB
allfonts.devanagari=Mangal
allfonts.dingbats=Wingdings
allfonts.lucida=Lucida Sans Regular
allfonts.symbol=Symbol
allfonts.thai=Lucida Sans Regular
allfonts.georgian=Sylfaen

serif.plain.alphabetic=Times New Roman
serif.plain.chinese-ms950=MingLiU
serif.plain.chinese-ms950-extb=MingLiU-ExtB
serif.plain.hebrew=David
serif.plain.japanese=MS Mincho
serif.plain.korean=Batang

serif.bold.alphabetic=Times New Roman Bold
serif.bold.chinese-ms950=PMingLiU
serif.bold.chinese-ms950-extb=PMingLiU-ExtB
serif.bold.hebrew=David Bold
serif.bold.japanese=MS Mincho
serif.bold.korean=Batang

serif.italic.alphabetic=Times New Roman Italic
serif.italic.chinese-ms950=PMingLiU
serif.italic.chinese-ms950-extb=PMingLiU-ExtB
serif.italic.hebrew=David
serif.italic.japanese=MS Mincho
serif.italic.korean=Batang

serif.bolditalic.alphabetic=Times New Roman Bold Italic
serif.bolditalic.chinese-ms950=PMingLiU
serif.bolditalic.chinese-ms950-extb=PMingLiU-ExtB
serif.bolditalic.hebrew=David Bold
serif.bolditalic.japanese=MS Mincho
serif.bolditalic.korean=Batang

sansserif.plain.alphabetic=Arial
sansserif.plain.chinese-ms950=MingLiU
sansserif.plain.chinese-ms950-extb=MingLiU-ExtB
sansserif.plain.hebrew=David
sansserif.plain.japanese=MS Gothic
sansserif.plain.korean=Gulim

sansserif.bold.alphabetic=Arial Bold
sansserif.bold.chinese-ms950=PMingLiU
sansserif.bold.chinese-ms950-extb=PMingLiU-ExtB
sansserif.bold.hebrew=David Bold
sansserif.bold.japanese=MS Gothic
sansserif.bold.korean=Gulim

sansserif.italic.alphabetic=Arial Italic
sansserif.italic.chinese-ms950=PMingLiU
sansserif.italic.chinese-ms950-extb=PMingLiU-ExtB
sansserif.italic.hebrew=David
sansserif.italic.japanese=MS Gothic
sansserif.italic.korean=Gulim

sansserif.bolditalic.alphabetic=Arial Bold Italic
sansserif.bolditalic.chinese-ms950=PMingLiU
sansserif.bolditalic.chinese-ms950-extb=PMingLiU-ExtB
sansserif.bolditalic.hebrew=David Bold
sansserif.bolditalic.japanese=MS Gothic
sansserif.bolditalic.korean=Gulim

monospaced.plain.alphabetic=Courier New
monospaced.plain.chinese-ms950=MingLiU
monospaced.plain.chinese-ms950-extb=MingLiU-ExtB
monospaced.plain.hebrew=Courier New
monospaced.plain.japanese=MS Gothic
monospaced.plain.korean=GulimChe

monospaced.bold.alphabetic=Courier New Bold
monospaced.bold.chinese-ms950=PMingLiU
monospaced.bold.chinese-ms950-extb=PMingLiU-ExtB
monospaced.bold.hebrew=Courier New Bold
monospaced.bold.japanese=MS Gothic
monospaced.bold.korean=GulimChe

monospaced.italic.alphabetic=Courier New Italic
monospaced.italic.chinese-ms950=PMingLiU
monospaced.italic.chinese-ms950-extb=PMingLiU-ExtB
monospaced.italic.hebrew=Courier New
monospaced.italic.japanese=MS Gothic
monospaced.italic.korean=GulimChe

monospaced.bolditalic.alphabetic=Courier New Bold Italic
monospaced.bolditalic.chinese-ms950=PMingLiU
monospaced.bolditalic.chinese-ms950-extb=PMingLiU-ExtB
monospaced.bolditalic.hebrew=Courier New Bold
monospaced.bolditalic.japanese=MS Gothic
monospaced.bolditalic.korean=GulimChe

dialog.plain.alphabetic=Arial
dialog.plain.chinese-ms950=MingLiU
dialog.plain.chinese-ms950-extb=MingLiU-ExtB
dialog.plain.hebrew=David
dialog.plain.japanese=MS Gothic
dialog.plain.korean=Gulim

dialog.bold.alphabetic=Arial Bold
dialog.bold.chinese-ms950=PMingLiU
dialog.bold.chinese-ms950-extb=PMingLiU-ExtB
dialog.bold.hebrew=David Bold
dialog.bold.japanese=MS Gothic
dialog.bold.korean=Gulim

dialog.italic.alphabetic=Arial Italic
dialog.italic.chinese-ms950=PMingLiU
dialog.italic.chinese-ms950-extb=PMingLiU-ExtB
dialog.italic.hebrew=David
dialog.italic.japanese=MS Gothic
dialog.italic.korean=Gulim

dialog.bolditalic.alphabetic=Arial Bold Italic
dialog.bolditalic.chinese-ms950=PMingLiU
dialog.bolditalic.chinese-ms950-extb=PMingLiU-ExtB
dialog.bolditalic.hebrew=David Bold
dialog.bolditalic.japanese=MS Gothic
dialog.bolditalic.korean=Gulim

dialoginput.plain.alphabetic=Courier New
dialoginput.plain.chinese-ms950=MingLiU
dialoginput.plain.chinese-ms950-extb=MingLiU-ExtB
dialoginput.plain.hebrew=David
dialoginput.plain.japanese=MS Gothic
dialoginput.plain.korean=Gulim

dialoginput.bold.alphabetic=Courier New Bold
dialoginput.bold.chinese-ms950=PMingLiU
dialoginput.bold.chinese-ms950-extb=PMingLiU-ExtB
dialoginput.bold.hebrew=David Bold
dialoginput.bold.japanese=MS Gothic
dialoginput.bold.korean=Gulim

dialoginput.italic.alphabetic=Courier New Italic
dialoginput.italic.chinese-ms950=PMingLiU
dialoginput.italic.chinese-ms950-extb=PMingLiU-ExtB
dialoginput.italic.hebrew=David
dialoginput.italic.japanese=MS Gothic
dialoginput.italic.korean=Gulim

dialoginput.bolditalic.alphabetic=Courier New Bold Italic
dialoginput.bolditalic.chinese-ms950=PMingLiU
dialoginput.bolditalic.chinese-ms950-extb=PMingLiU-ExtB
dialoginput.bolditalic.hebrew=David Bold
dialoginput.bolditalic.japanese=MS Gothic
dialoginput.bolditalic.korean=Gulim

# Search Sequences

sequence.allfonts=alphabetic/default,dingbats,symbol

sequence.serif.GBK=alphabetic,chinese-ms936,dingbats,symbol,chinese-ms936-extb
sequence.sansserif.GBK=alphabetic,chinese-ms936,dingbats,symbol,chinese-ms936-extb
sequence.monospaced.GBK=chinese-ms936,alphabetic,dingbats,symbol,chinese-ms936-extb
sequence.dialog.GBK=alphabetic,chinese-ms936,dingbats,symbol,chinese-ms936-extb
sequence.dialoginput.GBK=alphabetic,chinese-ms936,dingbats,symbol,chinese-ms936-extb

sequence.serif.GB18030=alphabetic,chinese-gb18030,dingbats,symbol,chinese-gb18030-extb
sequence.sansserif.GB18030=alphabetic,chinese-gb18030,dingbats,symbol,chinese-gb18030-extb
sequence.monospaced.GB18030=chinese-gb18030,alphabetic,dingbats,symbol,chinese-gb18030-extb
sequence.dialog.GB18030=alphabetic,chinese-gb18030,dingbats,symbol,chinese-gb18030-extb
sequence.dialoginput.GB18030=alphabetic,chinese-gb18030,dingbats,symbol,chinese-gb18030-extb

sequence.serif.x-windows-950=alphabetic,chinese-ms950,dingbats,symbol,chinese-ms950-extb
sequence.sansserif.x-windows-950=alphabetic,chinese-ms950,dingbats,symbol,chinese-ms950-extb
sequence.monospaced.x-windows-950=chinese-ms950,alphabetic,dingbats,symbol,chinese-ms950-extb
sequence.dialog.x-windows-950=alphabetic,chinese-ms950,dingbats,symbol,chinese-ms950-extb
sequence.dialoginput.x-windows-950=alphabetic,chinese-ms950,dingbats,symbol,chinese-ms950-extb

sequence.serif.x-MS950-HKSCS=alphabetic,chinese-ms950,chinese-hkscs,dingbats,symbol,chinese-ms950-extb
sequence.sansserif.x-MS950-HKSCS=alphabetic,chinese-ms950,chinese-hkscs,dingbats,symbol,chinese-ms950-extb
sequence.monospaced.x-MS950-HKSCS=chinese-ms950,alphabetic,chinese-hkscs,dingbats,symbol,chinese-ms950-extb
sequence.dialog.x-MS950-HKSCS=alphabetic,chinese-ms950,chinese-hkscs,dingbats,symbol,chinese-ms950-extb
sequence.dialoginput.x-MS950-HKSCS=alphabetic,chinese-ms950,chinese-hkscs,dingbats,symbol,chinese-ms950-extb

sequence.serif.x-MS950-HKSCS-XP=alphabetic,chinese-ms950,chinese-hkscs,dingbats,symbol,chinese-ms950-extb
sequence.sansserif.x-MS950-HKSCS-XP=alphabetic,chinese-ms950,chinese-hkscs,dingbats,symbol,chinese-ms950-extb
sequence.monospaced.x-MS950-HKSCS-XP=chinese-ms950,alphabetic,chinese-hkscs,dingbats,symbol,chinese-ms950-extb
sequence.dialog.x-MS950-HKSCS-XP=alphabetic,chinese-ms950,chinese-hkscs,dingbats,symbol,chinese-ms950-extb
sequence.dialoginput.x-MS950-HKSCS-XP=alphabetic,chinese-ms950,chinese-hkscs,dingbats,symbol,chinese-ms950-extb

sequence.allfonts.UTF-8.hi=alphabetic/1252,devanagari,dingbats,symbol
sequence.allfonts.UTF-8.ja=alphabetic,japanese,devanagari,dingbats,symbol

sequence.allfonts.windows-1255=hebrew,alphabetic/1252,dingbats,symbol

sequence.serif.windows-31j=alphabetic,japanese,dingbats,symbol
sequence.sansserif.windows-31j=alphabetic,japanese,dingbats,symbol
sequence.monospaced.windows-31j=japanese,alphabetic,dingbats,symbol
sequence.dialog.windows-31j=alphabetic,japanese,dingbats,symbol
sequence.dialoginput.windows-31j=alphabetic,japanese,dingbats,symbol

sequence.serif.x-windows-949=alphabetic,korean,dingbats,symbol
sequence.sansserif.x-windows-949=alphabetic,korean,dingbats,symbol
sequence.monospaced.x-windows-949=korean,alphabetic,dingbats,symbol
sequence.dialog.x-windows-949=alphabetic,korean,dingbats,symbol
sequence.dialoginput.x-windows-949=alphabetic,korean,dingbats,symbol

sequence.allfonts.x-windows-874=alphabetic,thai,dingbats,symbol

sequence.fallback=lucida,\
 
chinese-ms950,chinese-hkscs,chinese-ms936,chinese-gb18030,\
 
japanese,korean,chinese-ms950-extb,chinese-ms936-extb,georgian

# Exclusion Ranges

exclusion.alphabetic=0700-1e9f,1f00-20ab,20ad-f8ff
exclusion.chinese-gb18030=0390-03d6,2200-22ef,2701-27be
exclusion.hebrew=0041-005a,0060-007a,007f-00ff,20ac-20ac

# Monospaced to Proportional width variant mapping
# (Experimental private syntax)
proportional.MS_Gothic=MS PGothic
proportional.MS_Mincho=MS PMincho
proportional.MingLiU=PMingLiU
proportional.MingLiU-ExtB=PMingLiU-ExtB

# Font File Names

filename.Arial=ARIAL.TTF
filename.Arial_Bold=ARIALBD.TTF
filename.Arial_Italic=ARIALI.TTF
filename.Arial_Bold_Italic=ARIALBI.TTF

filename.Courier_New=COUR.TTF
filename.Courier_New_Bold=COURBD.TTF
filename.Courier_New_Italic=COURI.TTF
filename.Courier_New_Bold_Italic=COURBI.TTF

filename.Times_New_Roman=TIMES.TTF
filename.Times_New_Roman_Bold=TIMESBD.TTF
filename.Times_New_Roman_Italic=TIMESI.TTF
filename.Times_New_Roman_Bold_Italic=TIMESBI.TTF

filename.SimSun=SIMSUN.TTC
filename.SimSun-18030=SIMSUN18030.TTC
filename.SimSun-ExtB=SIMSUNB.TTF

filename.MingLiU=MINGLIU.TTC
filename.MingLiU-ExtB=MINGLIUB.TTC
filename.PMingLiU=MINGLIU.TTC
filename.PMingLiU-ExtB=MINGLIUB.TTC
filename.MingLiU_HKSCS=hkscsm3u.ttf

filename.David=DAVID.TTF
filename.David_Bold=DAVIDBD.TTF

filename.MS_Mincho=MSMINCHO.TTC
filename.MS_PMincho=MSMINCHO.TTC
filename.MS_Gothic=MSGOTHIC.TTC
filename.MS_PGothic=MSGOTHIC.TTC

filename.Gulim=gulim.TTC
filename.Batang=batang.TTC
filename.GulimChe=gulim.TTC

filename.Lucida_Sans_Regular=LucidaSansRegular.ttf
filename.Mangal=MANGAL.TTF
filename.Symbol=SYMBOL.TTF
filename.Wingdings=WINGDING.TTF

filename.Sylfaen=sylfaen.ttf


0
markspace
7/22/2012 6:31:04 PM
On Sunday, July 22, 2012 11:31:04 AM UTC-7, markspace wrote:
> On 7/22/2012 10:37 AM, Philip Brown wrote:
> 
> > step 1: copy (jre)/lib/fontconfig.properties.src to
> > fontconfig.properties step 2: modify the line
> >
> > sequence.allfonts=alphabetic/default,dingbats,symbol
> >
> > to be sequence.allfonts=alphabetic/default,dingbats,symbol,japanese
> 
> 
> Thanks for reporting your solution back to us, it helps out everyone. 
> However I'm concerned that you may have, or have now, a defective 
> installation.  Here's my file;  there's already a different line for 
> Japanese script set.  Is your file very different from mine?
> 
> 

I'm not sure what you mean by "japanese script set".
Please identify the specific line you mean.

If you mean, "Hey there are lines in here that reference japanese, so it should work already"..
well, yes, that was exactly my first impression, too! :) but I found it was neccessary to make the above tweak.

I'm going to reference my full source code in a followup post.
0
phil178 (84)
7/22/2012 6:40:45 PM
On 7/22/2012 10:37 AM, Philip Brown wrote:
>
> step 1: copy (jre)/lib/fontconfig.properties.src to

I found some more info, which I think I'll archive in this thread.

Some older documentation on the fontconfig.properties file:


http://docs.oracle.com/javase/1.5.0/docs/guide/intl/fontconfig.html


This software is referenced by the Java 7 release notes, apparently for 
building fontconfig files.

http://www.freedesktop.org/wiki/Software/fontconfig

http://docs.oracle.com/javase/7/docs/technotes/guides/2d/enhancements70.html
0
markspace
7/22/2012 6:47:54 PM
On Sunday, July 22, 2012 10:37:13 AM UTC-7, Philip Brown wrote:
>
> Yeah, I figured.
> The good news is, I found a solution to get the JRE working properly in windows, so it can work as well as MacOS.
> 
> 

fyi, if anyone is curious as to what exactly my program is doing:

I thought I had lost the source code, which made me very sad:( but I found an ooold version of it.

For the terminally curious, I've made it available at

http://www.bolthole.com/jdrill/jdrill-2.0-src.tar.gz

Warning: It was written in 1999, and in AWT :)

It's rather long, so for anyone interested, I'll suggest that you look at the GamePanel class (which is the main window), and specifically the (Label) MAIN_B object, which is the object that initially comes up with a Kanji char in it.

It should be noted that it does "set a font"; however, it just grabs the generic "dialog" font. Paraphrasing the code a bit:
font = new Font("dialog", 0, 24);

This gets its label string set to a value cached from a 
KanjiDicLine obj, either from obj.getEnglish or obj.getKanji

The Kanji object is a regular String object, populated by an operational chain that looks something like 
BufferedReader(InputStreamReader(file, "EUCJIS")).readLine
  ->String ->StringBuffer ->char[] -> String
(mostly in parseKDLine(). which is used to parse a line from the dictionary file "KanjiDic", a small version of which is in the source code tarfile)

So basically, it is a raw unicode string.
Which is supposed to be handled by java transparently, I thought.

I set the Label's label to be a raw unicode string, and expect it to "do the right thing".

On MacOS, it does the right thing. On windows, it doesnt, unless I do that hack.

 
 
> step 1: copy (jre)/lib/fontconfig.properties.src to fontconfig.properties
> step 2: modify the line
> 
> sequence.allfonts=alphabetic/default,dingbats,symbol
> 
> to be
> sequence.allfonts=alphabetic/default,dingbats,symbol,japanese
> 
0
phil178 (84)
7/22/2012 7:09:18 PM
Philip Brown wrote:
> Lew wrote:
>> Philip Brown wrote:
>> I'm hoping someone can tell me the magic to get java [sic] (6 or 7) to display unicode [sic] chars under ms-windows [sic]?
>>
>> This is really an OS question.
>>
>> Java will emit characters using the target OS's encoding by default.
>>
>> The fact is that Java is already displaying Unicode characters. However it is
>> Windows that is failing to render them.
>>
>> Do you set the encoding explicitly in your program.
>
> I think I did.

Then show us the line of code where you did.

You don't need to guess. Look at the code. You either will see an encoding 
specified or you won't.

> If I didnt, wouldnt it fail under macos [sic]?

Not if the default encoding of the platform and available fonts just 
coincidentally happen to be what you want.

> It works under macos [sic], as I said.

Yes, and that's not relevant.

> Similarly, if I failed to set the encoding properly... wouldnt it just display gibberish chars?

No. It will either display the characters that correspond according to its own 
encoding, or the placeholder for characters that it doesn't recognize or for 
which it doesn't have an appropriate font.

And what do you mean by "gibberish"?

> Instead, its displaying the old empty square "no font mapping for this char" glyph.

Eh, so absent your answer about what encoding you specified, I can only guess 
that either the Windows encoding doesn't give you what you want, which 
historically has been an issue with Windows but I don't know about your 
version, or you don't have the fonts you need.

Since you won't confirm your encoding choices, or even show the code you 
vaguely describe with respect to the fonts you select, it's a little difficult 
to take the answer any further.

> Similarly.. when it attempts to display a char, it is displaying ONE empty-square.
> If the encoding was not set, it would display two empty chars, since it's displaying a 2-byte "widechar"

Maybe. Maybe not. It depends on what the default platform encoding is.

> Not to mention that the same program has worked under earlier versions of windows and jre.
> (And by "same program", I mean *same* program)

OK, whatever.

-- 
Lew
Honi soit qui mal y pense.
http://upload.wikimedia.org/wikipedia/commons/c/cf/Friz.jpg
0
noone7 (4050)
7/22/2012 8:15:42 PM
Reply:

Similar Artilces:

java.lang.ExceptionInInitializerError: java.lang.ArrayIndexOutOfBoundsException
Hi, I am new to DB2. I am getting this error while loading the DB2Driver. I don't have any idea about where i might have gone wrong. please help me. Below is the stack trace. Stack Trace: java.lang.ExceptionInInitializerError: java.lang.ArrayIndexOutOfBoundsException at COM.ibm.db2.jdbc.app.DB2Driver.SQLAllocEnv(Native Method) at COM.ibm.db2.jdbc.app.DB2Driver.<init>(DB2Driver.java:245) at COM.ibm.db2.jdbc.app.DB2Driver.<clinit>(DB2Driver.java:130) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Cla...

Java in Java
Is it possible to download a Java app (applet etc?) and run it inside a desktop Java app? -- Dirk http://www.transcendence.me.uk/ - Transcendence UK http://www.theconsensus.org/ - A UK political party http://www.onetribe.me.uk/wordpress/?cat=5 - Our podcasts on weird stuff Dirk Bruere at NeoPax wrote: > Is it possible to download a Java app (applet etc?) and run it inside a > desktop Java app? > Quite likely, but you won't necessarily get the same security model, unless you were careful about it. -- Daniel Pitts' Tech Blog: <http://virtualinfinity.net/wordpress/&g...

Java Java
Have my first Open Source Linux Java Project. Working on a second right now. Coming out with a distro called OPEN*WINDOWS. It will be at www.black-and-company.com tab wrote: > Have my first Open Source Linux Java Project. > Working on a second right now. > > Coming out with a distro called OPEN*WINDOWS. > > It will be at www.black-and-company.com > Wasn't that the whole point of Lindows? Oh, right, we didn't care for that either. tab wrote: > Have my first Open Source Linux Java Project. > Working on a second right now. > > Coming out with a ...

java.lang.StringIndexOutOfBoundsException: String index out of range: 23 at java.lang.String.charAt(String.java:460)
Hi All I am having the torque3.1.jar and postgresql-7.4. I have compiled the new jdbc driver called as postgresql.jar and have placed it in the lib directory from where the ant scripts catch the jars. Whenever i try to access through torque gestList = BaseGestlistPeer.doSelect(new Criteria()); this error arises java.lang.StringIndexOutOfBoundsException: String index out of range: 23 at java.lang.String.charAt(String.java:460) at org.postgresql.jdbc2.ResultSet.toTimestamp(ResultSet.java:1653) at org.postgresql.jdbc2.ResultSet.getTimestamp(ResultSet.java...

java.lang.Set with elements of type java.lang.Set
Roughly I do something along the lines of: Set set = new HashSet(); Set elem = new HashSet(); set.add(elem); // now we change the elem and add it again to the set elem.add(some object here); set.add(elem); I found out the hard way that 'set' may now contain 'elem' either once or twice, the reason being that 'elem.add()' changes the hashCode of elem such that it is not noticed that it is in 'set' already on the 2nd 'set.add()'. Question: What I would actually want is an IdentityHashSet() set = new IdentityHashSet() but this does not...

to use import java.lang.* or import java.lang.Math or none at all?
Hi guys, i knew that by default all java.lang classes will be imported by the compiler during compilation. but, to make it easier for the computer, should i specify which class i really will be using? does this action will boost the performance during compilation and runtime or not a matter at all? the answer to this post will definitely affect my programming style in the future when i'm considering "to import or not to import"... hmm,,, thanks in advance. JPractitioner wrote: > i knew that by default all java.lang classes will be imported by the > compiler during com...

modifying java.lang.String.java
Hi, I'm trying to modify java.lang.String.java and add the modified String.class to rt.jar [THIS IS FOR MYSELF ONLY AND WILL NOT BE DEPLOYED]. I cannot add "private final boolean tainted[] = new boolean[5];" to String.java. If I do, it still compiles and I can add it to rt.jar and compile a test program against it. However, the JVM crashes with a strange message: java.lang.IllegalArgumentException: name can't be empty at java.security.BasicPermission.init(Unknown Source) at java.security.BasicPermission.<init>(Unknown Source) at java....

Error occurred during initialization of VM java/lang/NoClassDefFoundError: java/lang/Object
I downloaded jdk-6u7-solaris-sparcv9.tar.Z and installed it by these commands: # zcat jdk-6u7-solaris-sparc.tar.Z | tar -xf - # pkgadd -d . SUNWj6rtx SUNWj6dvx SUNWj6dmx # /usr/jdk/instances/jdk1.6.0/bin/sparcv9/java -version Error occurred during initialization of VM java/lang/NoClassDefFoundError: java/lang/Object # ls /usr/jdk/instances/ jdk1.5.0 jdk1.6.0 # uname -a SunOS sun1 5.10 Generic sun4u sparc SUNW,Sun-Blade-2500 Please help to fix the error. Thanks. TsanChung wrote: > I downloaded jdk-6u7-solaris-sparcv9.tar.Z and installed it by these > commands: > # zcat jdk-6u7-so...

java.lang vs java.util
Surprising to see something defined in java.lang <http://developer.android.com/reference/java/lang/Iterable.html> depend on something defined in java.util <http://developer.android.com/reference/java/util/Iterator.html>. Surely the hierarchy should go the other way? On 4/1/2011 9:11 PM, Lawrence D'Oliveiro wrote: > Surprising to see something defined in java.lang > <http://developer.android.com/reference/java/lang/Iterable.html> depend on > something defined in java.util > <http://developer.android.com/reference/java/util/Iterator.html>. > > ...

Error occurred during intialization of VM java/lang/NoClassDefFoundError: java/lang/Object
Good day to all, I have installed the j2se/netbeans binary bundle on red hat 9. I can run everything perfectly as root but when I try to compile with any other user I get: Error occurred during intialization of VM java/lang/NoClassDefFoundError: java/lang/Object When I saw this it seemed like a permissions problem but I checked the permissions and everything seemed fine. All users have execute permissions of javac and java. I have read other threads dealing with the same or similar problem but have not reached any solution yet. I would appreciate if anyone that has run into this type o...

Poll: Is a Java Method an Instance of the Java Class java.lang.reflect.Method? Please reply with YES or NO.
Hi, Poll: Is a Java Method an Instance of the Java Class java.lang.reflect.Method? Please put YES or NO as the first word in your reply. Add comments after it if you wish. I'll make a YES/NO count after some time. Kind regards, Paka Paka Small wrote: > Poll: Is a Java Method an Instance of the Java Class > java.lang.reflect.Method? It's not subject to vote. It's defined by the language. You might as well ask, "Is 'int' a primitive or a reference type?". Your vote will not change reality. > Please put YES or NO as the first word in your reply. Add c...

java.lang.NoClassDefFoundError: java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
Hi, I'm trying to use the httpclient within Jython (see http://jakarta.apache.org/commons/httpclient/ for more information on the httpclient). My Jython version is: Jython 2.1 on java1.4.2_04 (JIT: null) My Java version is: java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) My CLASSPATH includes: jdom.jar xerces.jar jython.jar jt400.jar log4j-1.2.8.jar commons-httpclient-2.0.jar When I just try to perform the import statements from example code I get the error pasted below....

CheckBox in Column of JTable: Exception: java.lang.String cannot be cast to java.lang.Boolean
Hello, I have discovered a hidden error. My project was working for awhile, but then I started to get the below error. My error comes from the fact that I'm using a checkbox in a jtable, and I'm using the below "getColumnClass". Thank you, compile: run: Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Boolean at javax.swing.JTable$BooleanRenderer.getTableCellRendererComponent(JTable.java:5412) at javax.swing.JTable.prepareRenderer(JTable.java:5735) at javax.swing.plaf.basic.BasicTableU...

Error occurred during initialization of VM java/lang/NoClassDefFoundError: java/lang/Object (ant/tomcat/spring)
Hi, I've been trying to get Spring working with ant and tomcat. Ant was building just fine, but I came in today and tried to build it and got this: Error occurred during initialization of VM java/lang/NoClassDefFoundError: java/lang/Object ?!?! Makes no sense to me. There _is_ an older version of java installed on my machine; but JAVA_HOME and ANT_HOME are set to the correct paths, and <which java>and <java -version> produce the correct version. Any help would greatly alleviate my frustration! Thanks in advance... Courtney ...

Web resources about - problem with java displaying unicode, under ms-windows - comp.lang.java.programmer

List of mammals displaying homosexual behavior - Wikipedia, the free encyclopedia
For these mammals, there is documented evidence of homosexual behavior of one or more of the following kinds: sexual behavior , courtship , affection ...

Facebook Displaying Page Insights On Page Admins’ Personal Pages?
Some Facebook page administrators are seeing modules on their personal pages displaying page insights ad, campaign , and like totals for pages ...

Facebook Displaying Unread Messages from Pages in a New Updates Module
Facebook is displaying a new “Updates” sidebar module which shows some users unread messages sent to them by Pages. Users will see the Updates ...

Don Lemon Holds Up Sign Displaying the N-Word, Uncensored, on Air CNN Live - YouTube
Don Lemon Holds Up Sign Displaying the N-Word, Uncensored, on Air Lemon held up a Confederate flag first before holding up the sign. He asked, ...

Hazelwood coal mine fire: Morwell residents displaying symptoms similar to cigarette smokers, expert ...
An expert says some locals near Victoria's Hazelwood mine fire have symptoms similar to cigarette smokers.

Police accused of displaying fake G20 weapons
Toronto's top police officer misled the public by displaying fake weapons used in a medieval-themed role-playing game to help justify their actions ...

No charges for U.S. host for displaying high-capacity magazine on TV
NBC television journalist David Gregory won't face charges for displaying a high-capacity ammunition magazine on his "Meet the Press" news program ...

Jays' Escobar suspended three games for displaying slur
Toronto Blue Jays shortstop Yunel Escobar has been suspended three games for displaying a homophobic slur on his eye-black during a game on Saturday. ...

Google Play Store now displaying age-based ratings
We reported back in May that Google was adding age-based ratings to all apps in the Play Store as determined by the International Age Rating ...

Apple displaying Ferraris & other cars at WWDC hinting at CarPlay announcements
... 2014 Filed under: AAPL Company , iOS Continue reading more about AAPL Company and iOS at 9to5Mac . What do you think? Discuss "Apple displaying ...

Resources last updated: 2/6/2016 8:02:04 PM