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
Comments
/cc @robpike |
It looks like this is a bug in maketables. I believe @mpvl is away. I'll try to take a look this week. |
@mpvl, could you look at this if you're back? |
Ping @mpvl. |
1 similar comment
Ping @mpvl. |
CL https://golang.org/cl/45830 mentions this issue. |
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. |
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).
The text was updated successfully, but these errors were encountered: