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

os: mishandled non-ascii console input on windows #4760

Closed
alexbrainman opened this issue Feb 5, 2013 · 4 comments
Closed

os: mishandled non-ascii console input on windows #4760

alexbrainman opened this issue Feb 5, 2013 · 4 comments
Milestone

Comments

@alexbrainman
Copy link
Member

What steps will reproduce the problem?

- Launch cmd
- Enter chcp 65001  (This selects the UTF-8 code page)
- Change the font to Lucida Console for the cmd window by right clicking the title bar
and selecting properties->font (Need to pick a font with glyphs for non-latin chars)
- run this program:

package main

import (
    "bufio"
    "fmt"
    "os"
    "log"
)

func main() {
    fmt.Print("Enter you name: ")
    in := bufio.NewReader(os.Stdin)
    input, err := in.ReadString('\n')
    if err != nil {
        log.Fatal(err)
    }
    fmt.Printf("Hello %v", input)
}

What is the expected output?

Enter you name: ã
Hello ã

What do you see instead?

Enter you name: ã
2013/02/05 15:30:08 EOF
exit status 1

Please use labels and text to provide additional information.

hg id
44bc519f3511 tip

user report: http://goo.gl/LWrjJ
@minux
Copy link
Member

minux commented Feb 5, 2013

Comment 1:

so we need to special case reading from console too.

@alexbrainman
Copy link
Member Author

Comment 2:

https://golang.org/cl/7312053/

Status changed to Started.

@alexbrainman
Copy link
Member Author

Comment 3:

This issue was closed by revision 2649868.

Status changed to Fixed.

@rsc rsc added this to the Go1.1 milestone Apr 14, 2015
@rsc rsc removed the go1.1maybe label Apr 14, 2015
@golang golang locked and limited conversation to collaborators Jun 24, 2016
@gopherbot
Copy link

CL https://golang.org/cl/33451 mentions this issue.

This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants