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

unicode: FoldCategory and FoldScript incorrectly defined #18186

Closed
IsaacDunlap opened this issue Dec 3, 2016 · 8 comments
Closed

unicode: FoldCategory and FoldScript incorrectly defined #18186

IsaacDunlap opened this issue Dec 3, 2016 · 8 comments
Assignees
Milestone

Comments

@IsaacDunlap
Copy link

@IsaacDunlap IsaacDunlap commented Dec 3, 2016

In Go version 1.7.3, the unicode package provides 2 maps: FoldCategory and FoldScript. FoldCategory is only supposed to map category names to tables of code points, but includes script names ("Common", "Greek", "Inherited"). By contrast, although FoldScript is supposed to map script names to tables of code points, the 3 script names ("Common", "Greek", "Inherited") are missing and FoldScript is an empty map.

This bug could be fixed by instead defining Fold Category and FoldScript thus:

var FoldCategory = map[string]*RangeTable{ "L": foldL, "Ll": foldLl, "Lt": foldLt, "Lu": foldLu, "M": foldM, "Mn": foldMn, }

var FoldScript = map[string]*RangeTable{ "Common": foldCommon, "Greek": foldGreek, "Inherited": foldInherited, }

This much better fits what the user of unicode expects when reading the descriptions of FoldCategory and FoldScript (as well as better matching what the names of the variables imply).

@IsaacDunlap IsaacDunlap changed the title unicode: FoldCategory and FoldScript bug. unicode: FoldCategory and FoldScript incorrectly defined Dec 3, 2016
@bradfitz bradfitz added this to the Go1.9 milestone Dec 3, 2016
@bradfitz
Copy link
Contributor

@bradfitz bradfitz commented Dec 3, 2016

/cc @robpike

@robpike
Copy link
Contributor

@robpike robpike commented Dec 3, 2016

This is outside my bailiwick. cc @mpvl @rsc

@rsc
Copy link
Contributor

@rsc rsc commented Dec 6, 2016

It looks like this is a bug in maketables. I believe @mpvl is away. I'll try to take a look this week.

@rsc rsc self-assigned this Dec 6, 2016
@bradfitz bradfitz added the NeedsFix label May 23, 2017
@bradfitz
Copy link
Contributor

@bradfitz bradfitz commented May 23, 2017

@mpvl, could you look at this if you're back?

@bradfitz
Copy link
Contributor

@bradfitz bradfitz commented Jun 7, 2017

Ping @mpvl.

1 similar comment
@bradfitz
Copy link
Contributor

@bradfitz bradfitz commented Jun 14, 2017

Ping @mpvl.

@gopherbot
Copy link

@gopherbot gopherbot commented Jun 15, 2017

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

@rsc
Copy link
Contributor

@rsc rsc commented Jun 15, 2017

Seems like @mpvl is away (not sure). I'll take care of this. I thought the tables were now generated from something in x/text, but unicode/maketables.go is still in the main distribution and editing and rerunning it has the desired effect, so good enough for me.

@gopherbot gopherbot closed this in 82abd41 Jun 15, 2017
@golang golang locked and limited conversation to collaborators Jun 15, 2018
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
5 participants
You can’t perform that action at this time.