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 The path to resolution is known, but the work has not been done.
Milestone

Comments

@crawshaw
Copy link
Member

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 The path to resolution is known, but the work has not been done. label Apr 2, 2018
@meirf
Copy link
Contributor

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

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 The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

5 participants