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

@alexbrainman alexbrainman commented Feb 5, 2013

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

This comment has been minimized.

Copy link
Member

@minux minux commented Feb 5, 2013

Comment 1:

so we need to special case reading from console too.
@alexbrainman

This comment has been minimized.

Copy link
Member Author

@alexbrainman alexbrainman commented Feb 7, 2013

Comment 2:

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

Status changed to Started.

@alexbrainman

This comment has been minimized.

Copy link
Member Author

@alexbrainman alexbrainman commented Feb 26, 2013

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

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Nov 22, 2016

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
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.