On Wed, 2014-12-10 at 15:36 -0800, Phil Race wrote: > > the character is encoded as <c3a4> (which is correct ihmo) > > but then mapped to ISOLatin1Encoding. > > \u00e4 (Umlaut) encoded as 8859 should just be "e4". > What you have above is UTF-8, whereas the PS printing path is > definitely expecting 8859-1. I looked and found that when I reviewed this > change > I commented it probably should be 8859-1 but didn't make a sufficient point > of it :-( > I thought that since we returned latin1 for the charset name we'd get the > right encoding > but apparently not, and I imagine what testing was done either didn't cover > this range > or the bug was overlooked. > > The following is the quick fix I think we need since I think printing and > ONLY printing > ever uses this code when we are using fontconfig :- > > diff --git a/src/java.desktop/unix/classes/sun/font/FcFontConfiguration.java > b/src/java.desktop/unix/classes/sun/font/FcFontConfiguration.java > --- a/src/java.desktop/unix/classes/sun/font/FcFontConfiguration.java > +++ b/src/java.desktop/unix/classes/sun/font/FcFontConfiguration.java > @@ -180,7 +180,7 @@ > String[] componentFaceNames = cfi[idx].getComponentFaceNames(); > FontDescriptor[] ret = new > FontDescriptor[componentFaceNames.length]; > for (int i = 0; i < componentFaceNames.length; i++) { > - ret[i] = new FontDescriptor(componentFaceNames[i], > StandardCharsets.UTF_8.newEncoder(), new int[0]); > + ret[i] = new FontDescriptor(componentFaceNames[i], > StandardCharsets.ISO_8859_1.newEncoder(), new int[0]); > } > > return ret; >
Hi Phil, Thanks for the reply! I thought it was something along the lines, but I wasn't confident enough for the fix. I applied your fix and (of course!) I can confirm it worked, and created a bug report: https://bugs.openjdk.java.net/browse/JDK-8067364 I also went ahead and tweaked the test case so that there's no need to print anymore: http://cr.openjdk.java.net/~neugens/8067364/webrev.00/ This webrev contains the updated test case based on the PrintSE test and your fix. I will be happy to push the fix myself if you prefer. Cheers, Mario