Skip to content
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

Merged
merged 1 commit into from
Dec 1, 2017
Merged

use PrintStream to avoid encoding issues #95

merged 1 commit into from
Dec 1, 2017

Conversation

hboutemy
Copy link
Collaborator

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

ps.write( data );
}
}

Copy link
Member

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( '€' );
Copy link
Member

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.

@hboutemy
Copy link
Collaborator Author

Good finding: proposed changes incorporated
and branch rebased on HEAD after #88 merge

@gnodet gnodet merged commit 40631bd into fusesource:master Dec 1, 2017
hboutemy added a commit that referenced this pull request Dec 2, 2017
reported #99 fix after #95 PrintStream copy of OutputStream
hboutemy added a commit that referenced this pull request Dec 2, 2017
reported #92 fix after #95 PrintStream copy of OutputStream
hboutemy added a commit that referenced this pull request Dec 2, 2017
reported #86 fix after #95 PrintStream copy of OutputStream
asfgit pushed a commit to apache/maven that referenced this pull request Feb 8, 2018
asfgit pushed a commit to apache/maven that referenced this pull request Feb 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants