Hi,
Currently, if you System.out.println() a string containing an
unencodeable character, the line gets silently swallowed, instead the
unencodeable character should be replaced by a question mark (at least
that's what Sun does on Windows).
This behavior doesn't appear to be specified anywhere, but testing
suggests that the proper way to do this is by calling setBadCharValue on
the Encoder in OutputStreamWriter.
OK to apply?
Regards,
Jeroen
Index: java/io/OutputStreamWriter.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/io/OutputStreamWriter.java,v
retrieving revision 1.9
diff -u -r1.9 OutputStreamWriter.java
--- java/io/OutputStreamWriter.java 9 May 2003 13:30:35 -0000
1.9
+++ java/io/OutputStreamWriter.java 27 Mar 2004 14:18:22 -0000
@@ -101,6 +101,14 @@
throws UnsupportedEncodingException
{
this.out = EncodingManager.getEncoder (out, encoding_scheme);
+ try
+ {
+ this.out.setBadCharValue('?');
+ }
+ catch(CharConversionException x)
+ {
+ // what can we do here?
+ }
}
/**
@@ -112,6 +120,14 @@
public OutputStreamWriter (OutputStream out)
{
this.out = EncodingManager.getEncoder (out);
+ try
+ {
+ this.out.setBadCharValue('?');
+ }
+ catch(CharConversionException x)
+ {
+ // what can we do here?
+ }
}
/**
_______________________________________________
Classpath mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/classpath