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

Command.StandardOutput.ReadLine() is unreadable #10

Closed
xjfnet opened this issue May 29, 2017 · 3 comments
Closed

Command.StandardOutput.ReadLine() is unreadable #10

xjfnet opened this issue May 29, 2017 · 3 comments

Comments

@xjfnet
Copy link
Contributor

xjfnet commented May 29, 2017

var line = cmd.StandardOuput.ReadLine();

line is unreadable : "?????????????"

using(var sr = new StreamReader(cmd.StandardOutput.BaseStream, Encoding.Default))
{
    var line = sr.ReadLine();
}

line is readable : "some unicode char"

@xjfnet
Copy link
Contributor Author

xjfnet commented May 29, 2017

just a little change to the source code, it will work well

        public InternalProcessStreamReader(StreamReader processStreamReader)
        {
            this.processStream = processStreamReader.BaseStream;
            this.pipe = new Pipe();
            /* set encoding as the origin StreamReader */
            this.reader = new StreamReader(this.pipe.OutputStream, processStreamReader.CurrentEncoding);
            this.task = Task.Run(() => this.BufferLoop());
        }

@madelson
Copy link
Owner

Will be addressed by #11

@madelson
Copy link
Owner

Fixed as of 1.3.0 (https://www.nuget.org/packages/MedallionShell/1.3.0)

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

No branches or pull requests

2 participants