mirror of
https://github.com/corda/corda.git
synced 2025-06-15 21:58:17 +00:00
fix portability problem in Strings test
There was a test in Strings.java that assumed the default character encoding was UTF-8, which is an invalid assumption on some platforms (e.g. Windows). This modifies the test to specify the encoding explicitly.
This commit is contained in:
@ -24,6 +24,17 @@ public class PrintStream extends OutputStream {
|
||||
this.autoFlush = autoFlush;
|
||||
}
|
||||
|
||||
public PrintStream(OutputStream out, boolean autoFlush, String encoding)
|
||||
throws UnsupportedEncodingException
|
||||
{
|
||||
this.out = out;
|
||||
this.autoFlush = autoFlush;
|
||||
|
||||
if (! (encoding.equals("UTF-8") || encoding.equals("ISO-8859-1"))) {
|
||||
throw new UnsupportedEncodingException(encoding);
|
||||
}
|
||||
}
|
||||
|
||||
public PrintStream(OutputStream out) {
|
||||
this(out, false);
|
||||
}
|
||||
|
Reference in New Issue
Block a user