Justin Couch wrote: > [EMAIL PROTECTED] wrote: > > > > It has recently come to our attention that the binary format file > > loaders for Portfolio aren't working due to recent changes in the JDK > > and how they handle character I/O with subclasses of InputReader. This > > has broken each of loaders that use binary files, and may be giving > > people problems. > > Ah.. you've beaten me to this. I was intending to send a mail off to the > J3D folks about the loader interfaces. Using Readers severly screws a > lot of binary inputs where you really do want an InputStream for. The > biggest problem that I face with this is using the loaders as content > handlers for URL/URN resolution. You always have input streams and this > requires you to build readers and deal with text problems etc. The crazy thing is, the default behavior has changed at least twice in recent versions of JDK 1.2. The reference/production version of the JDK 1.2 that I've been using until yesterday started changing all bytes with the high-order bit set to 0xFD. The latest version of the JDK, version 1.2.1, strips the high-order bit, but leaves everything else intact. The versions right before the reference/production release didn't mess with the character encodings at all. Having said all that, I believe the correct solution to this is to use the constructor for the InputStreamReader that allows you to specify the encoding type. In our case, I used "ISO8859_1" as the argument, and it appears to have fixed the problems we've had (still testing), and still allows us to use Readers. FileInputStream fis = new FileInputStream(file); InputStreamReader isr = new InputStreamReader(fis, "ISO8859_1"); The complete list of acceptable values for encodings is at: http://java.sun.com/products/jdk/1.1/docs/guide/intl/encoding.doc.html Steve -- Steve Pietrowicz - [EMAIL PROTECTED] Project Manager - NCSA Java 3D Group NCSA Portfolio: http://havefun.ncsa.uiuc.edu/Java3D/portfolio/ New Beta 2a release! New Loaders, record and replay of your Java 3D apps and more! Freely available for non-commercial use! You Build It VR: http://havefun.ncsa.uiuc.edu/Java3D/YouBuildItVR/ Build your own multi-user virtual worlds with no programming experience! The Java3D FAQ: http://tintoy.ncsa.uiuc.edu/~srp/java3d/faq.html Java News Network: http://tintoy.ncsa.uiuc.edu/~srp/java/javanews.html ===================================================================== To subscribe/unsubscribe, send mail to [EMAIL PROTECTED] Java 3D Home Page: http://java.sun.com/products/java-media/3D/
