file.encoding.pkg

Date view Thread view Subject view Author view

From: Godmar Back (gback@cs.utah.edu)
Date: Sun Dec 13 1998 - 16:26:50 EST


 I intend to change ByteToCharConverter as follows:

static {
        /* NB.: encodingRoot = System.getProperty("file.encoding.pkg");
         * would be pointless. Either file.encoding.pkg == kaffe.io, in
         * which it does not matter, or if file.encoding.pkg is set to
         * something else, then these other implementations would have to be
         * subclasses of kaffe.io.ByteToCharConverter. However, if someone
         * subclasses kaffe.io.ByteToCharConverter, he might as well put it
         * in this package. There's no documented way to add converters
         * to Java, since Sun implements this internally in sun.io.*;
         *
         * Secondly, by ignoring the file.encoding.pkg property, we're
         * free to redefine it. This helps not 100% pure Java apps such
         * as HotJava that access sun.io.* directly.
         */
        encodingRoot = "kaffe.io";
        encodingDefault = System.getProperty("file.encoding");
}

The story behing this is that HotJava calls sun.io.getConverter, which
looks at "file.encoding.pkg" to create a "kaffe/io/ByteToCharConverter"
object, but then wants to cast it to a sun/io/ByteToCharConverter.

By ignoring the file.encoding.pkg property (and setting it to "sun.io.",
we can make HotJava happy.

I already asked this, but nobody was able to answer this: is this
file.encoding stuff documented? More importantly, is there a Sun
sanctioned way of adding converters? I don't believe so, given that
they MUST be subclasses of sun.io.ByteToCharConverter.
Since there's no way, let's not honor the file.encoding property.

Now it says this:

HOTJAVA_HOME is set to /q/gback/HotJava1.1.5
[Starting HotJava]
[Initializing globals]
[Creating frame]
java.io.IOException
    at java/lang/Throwable.<init>(31)
    at java/lang/Exception.<init>(17)
    at java/io/IOException.<init>(18)
    at sun/awt/image/GifImageDecoder.readHeader(299)
    at sun/awt/image/GifImageDecoder.produceImage(138)
    at sun/awt/image/InputStreamImageSource.doFetch(265)
    at sun/awt/image/ImageFetcher.fetchloop(151)
    at sun/awt/image/ImageFetcher.run(127)
sun.awt.image.ImageFormatException: not a GIF file.
    at java/lang/Throwable.<init>(37)
    at java/lang/Exception.<init>(21)
    at sun/awt/image/ImageFormatException.<init>(27)
    at sun/awt/image/GifImageDecoder.error(102)
    at sun/awt/image/GifImageDecoder.readHeader(304)
    at sun/awt/image/GifImageDecoder.produceImage(138)
    at sun/awt/image/InputStreamImageSource.doFetch(265)
    at sun/awt/image/ImageFetcher.fetchloop(151)
    at sun/awt/image/ImageFetcher.run(127)

        - Godmar


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Sat Sep 23 2000 - 19:57:14 EDT