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
cancelreader.NewReader
not support chinese?
#393
Comments
but it was successful on |
Check out this issue golang/go#54389 (comment) |
As explained in the upstream issue, it looks like this input is not utf-8. |
yes, windows is |
Yeah, so it likely does not make sense to support non UTF-8 encodings, unfortunately. |
Yes, it fixed! @meowgorithm But I have a second question: On Windows run tea.program use code: package main
import (
"fmt"
"golang.org/x/sys/windows"
"unicode/utf16"
)
var fileShareValidFlags uint32 = 0x00000007
func main() {
var originalMode uint32
handle, _ := windows.CreateFile(
&(utf16.Encode([]rune("CONIN$\x00"))[0]), windows.GENERIC_READ|windows.GENERIC_WRITE,
fileShareValidFlags, nil, windows.OPEN_EXISTING, windows.FILE_FLAG_OVERLAPPED, 0)
_ = windows.GetConsoleMode(handle, &originalMode)
// 503
fmt.Println(originalMode)
// problematic mode
//windows.SetConsoleMode(handle, 992)
} |
@fzdwx Would you mind opening a separate issue for this since it's a bit of a separate topic? That way it won't get lost. |
@fzdwx This is now fixed in |
Thanks, it works! 🎉 |
When I use textinput, an error (could not decode rune) occurs when entering Chinese,i found that it is probably the following place:
Then I wrote a test code:
When I type
好
,os.stdin
returns the result correctly, butcancelreader
does notoutput
The text was updated successfully, but these errors were encountered: