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

x/text: ianaindex returns no encoding for gb2312 #24636

Open
crawshaw opened this issue Apr 2, 2018 · 2 comments
Open

x/text: ianaindex returns no encoding for gb2312 #24636

crawshaw opened this issue Apr 2, 2018 · 2 comments
Labels
NeedsFix
Milestone

Comments

@crawshaw
Copy link
Member

@crawshaw crawshaw commented Apr 2, 2018

Using the golang.org/x/text/encoding/ianaindex package.

        encoding, err := ianaindex.MIME.Encoding("gb2312")
        fmt.Println(encoding, err) // prints <nil> <nil>

I believe it should be returning simplifiedchinese.HZBG2312.

cc @mpvl

@gopherbot gopherbot added this to the Unreleased milestone Apr 2, 2018
@bcmills bcmills added the NeedsFix label Apr 2, 2018
@meirf
Copy link
Contributor

@meirf meirf commented Jun 18, 2018

This specific behavior has been around since Encoding was added.

To fix this particular example, would probably just need an entry:
enc2025: simplifiedchinese.HZGB2312,
Though I wonder if there's a way to generate the encodings from a public source.

The code has this:

// TODO: the coverage of this index is rather spotty. Allowing users to set
// encodings would allow:
// - users to increase coverage
// - allow a partially loaded set of encodings in case the user doesn't need to
//   them all.
// - write an OS-specific wrapper for supported encodings and set them.

@mooijtech
Copy link

@mooijtech mooijtech commented Dec 10, 2021

Having this problem in 2021.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsFix
Projects
None yet
Development

No branches or pull requests

5 participants