-
Notifications
You must be signed in to change notification settings - Fork 139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use PrintStream to avoid encoding issues #95
Conversation
ps.write( data ); | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's missing the following method:
@Override
public void write( byte[] buf, int off, int len )
{
for (int i = 0; i < len; i++)
{
write( buf[off + i] );
}
}
OutputStream os = new FilterPrintStream(System.out); | ||
os.write( 'A' ); | ||
os.write( 'B' ); | ||
os.write( '€' ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is actually an illegal method call.
Even if the parameter is an integer, the assumption is that it's a byte, so between 0 and 255.
Maybe using "€".getBytes()
? Which I've done and hit the missing method above.
Good finding: proposed changes incorporated |
should fix issue #93 this this avoids any guess on encoding and let original PrintStream do its job
test code from #88 is also committed to ease testing