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

Scanf %c field yields 0xFFFD for non-ascii characters #866

Closed
stevenblenkinsop opened this issue Jun 15, 2010 · 2 comments
Closed

Scanf %c field yields 0xFFFD for non-ascii characters #866

stevenblenkinsop opened this issue Jun 15, 2010 · 2 comments

Comments

@stevenblenkinsop
Copy link

Before filing a bug, please check whether it has been fixed since
the latest release: run "hg pull -u" and retry what you did to
reproduce the problem.  Thanks.

What steps will reproduce the problem?
1. Run program:

package main

import (
    "fmt"
)

func main() {
    var c int
    for {
        fmt.Scanf("%c", &c)
        fmt.Printf("0x%X %c\n", c, c)
    }
}

2. Type non-ascii characters and press enter.

What is the expected output?
For each character entered (including '\n'), that character's hex representation
followed by the character.

What do you see instead?
For non-ascii characters, Scanf reads 0xFFFD


What is your $GOOS?  $GOARCH?
linux 386

Which revision are you using?  (hg identify)
8e47d13b38be+ tip
(also in release)

Please provide any additional information below.
@robpike
Copy link
Contributor

robpike commented Jun 15, 2010

Comment 1:

Owner changed to r...@golang.org.

Status changed to Accepted.

@robpike
Copy link
Contributor

robpike commented Jun 16, 2010

Comment 2:

This issue was closed by revision d60312c.

Status changed to Fixed.

@golang golang locked and limited conversation to collaborators Jun 24, 2016
@rsc rsc unassigned robpike Jun 22, 2022
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

3 participants