Skip to content

use PrintStream to avoid encoding issues#95

Merged
gnodet merged 1 commit intofusesource:masterfrom
hboutemy:printstream
Dec 1, 2017
Merged

use PrintStream to avoid encoding issues#95
gnodet merged 1 commit intofusesource:masterfrom
hboutemy:printstream

Conversation

@hboutemy
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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