Skip to content

Commit 1a589e6

Browse files
committed
OutputStreamWriter only writes UTF-8; should it write ISO-8859-1?
1 parent 9020eee commit 1a589e6

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

sources/net.sf.j2s.java.core/src/java/io/OutputStreamWriter.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,12 @@ public class OutputStreamWriter extends Writer {
109109
public OutputStreamWriter(OutputStream out, String charsetName) throws UnsupportedEncodingException {
110110
super(out);
111111
this.stream = out;
112-
setCharset(charsetName);
112+
try {
113+
setCharset(charsetName);
114+
} catch (UnsupportedEncodingException e) {
115+
e.printStackTrace();
116+
System.err.println("OutputStreamWriter: " + charsetName + " not supported (only UTF-8 in SwingJS)");
117+
}
113118

114119
// se = StreamEncoder.forOutputStreamWriter(out, this, charsetName);
115120
}

0 commit comments

Comments
 (0)