From: Godmar Back (gback@cs.utah.edu)
Date: Wed Dec 02 1998 - 10:44:50 EST
The reason I asked that question yesterday:
HotJava fails now with
sunw.hotjava.doc.DocException: Conversion 8859_1 not found.
at java/lang/Throwable.<init>(37)
at java/lang/Exception.<init>(line unknown, pc 0x2)
at sunw/hotjava/doc/DocException.<init>(line unknown, pc 0x2)
at sunw/hotjava/ui/HotList.readHTMLFile(1624)
at sunw/hotjava/ui/HotListReader.run(line unknown, pc 0x8)
at java/lang/Thread.run(140)
Which I suppose is due to a
String (byte[], "8859_1")
failing.
So I looked some at how Kaffe handles this encoding stuff, and
I realized that kaffe/io/ByteToCharConverter.java
reads the system properties file.encoding and file.encoding.pkg
static {
encodingRoot = System.getProperty("file.encoding.pkg");
encodingDefault = System.getProperty("file.encoding");
}
and then does a
public static ByteToCharConverter getConverter ( String enc )
...
return ((ByteToCharConverter)Class.forName(encodingRoot + ".Byte
ToChar" + enc).newInstance());
...
which incidentally leads to the attempt to look up
"kaffe.io.BytetoCharnull"
because System.c set file.encoding.pkg, but not file.encoding:
setProperty(p, "file.encoding.pkg", "kaffe.io");
So, given that there is a class kaffe.io.BytetoCharDefault, should
there be a
setProperty(p, "file.encoding", "Default");
? Now that's of course not directly related to the 8859 prob, but
I thought I mention it.
Second and more importantly, it would be nice to document stuff in
kaffe.*. If I want to add the 8859_1 encoding, what would be the
best way to do it?
I know I presumably need to implement ByteToChar8859_1 and
CharToByte8859_1 --- but should its methods be native or not?
Also, I think it's possible that it will simply be the default
encoding since 8859_1 is simply an 8bit character set.
So it would be nice to be able to reuse the methods in
kaffe.io.ByteToCharDefault. In order for that to happen, we would
have to make them static, however.
What do you think?
- Godmar
This archive was generated by hypermail 2b29 : Sat Sep 23 2000 - 19:57:04 EDT