Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail From: Philip Brown Newsgroups: comp.lang.java.programmer Subject: Re: problem with java displaying unicode, under ms-windows Date: Sun, 22 Jul 2012 12:09:18 -0700 (PDT) Organization: http://groups.google.com Lines: 47 Message-ID: <1ccec3d0-3d93-4af0-a2ae-ecc906f2d118@googlegroups.com> References: <096d855d-7df4-4591-a498-818ae0bb193c@googlegroups.com> NNTP-Posting-Host: 173.58.246.116 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: posting.google.com 1342984159 19652 127.0.0.1 (22 Jul 2012 19:09:19 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sun, 22 Jul 2012 19:09:19 +0000 (UTC) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=173.58.246.116; posting-account=CiEMKgoAAADyVniih7tiexmSpPX6JYhp User-Agent: G2/1.0 X-Received-Bytes: 3220 Xref: csiph.com comp.lang.java.programmer:16227 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 >