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

strings.Title - fix ability to handle unicode punctuation #1310

Merged
merged 1 commit into from
Feb 14, 2022

Conversation

hairyhenderson
Copy link
Owner

There's a bug in Go's strings.Title function which prevents it from recognizing words separated by certain unicode punctuation marks. In Go 1.18, strings.Title will be deprecated. This replaces that usage with golang.org/x/text/cases, as suggested by the Go 1.18 documentation.

I've also updated the ToUpper and ToLower functions accordingly, and added the ability to later define a specific BCP 47 language tag (not yet sure how, but the plumbing is laid).

Signed-off-by: Dave Henderson [email protected]

@hairyhenderson hairyhenderson self-assigned this Feb 14, 2022
@hairyhenderson hairyhenderson enabled auto-merge (squash) February 14, 2022 01:09
@hairyhenderson hairyhenderson merged commit d8f35a0 into master Feb 14, 2022
@hairyhenderson hairyhenderson deleted the fix-strings-title-unicode branch February 14, 2022 01:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant