Skip to content
This repository has been archived by the owner on Mar 31, 2023. It is now read-only.

[ToDo] Use forthcoming strings.ToValidUTF8 #19

Closed
ymmt2005 opened this issue Nov 2, 2018 · 2 comments
Closed

[ToDo] Use forthcoming strings.ToValidUTF8 #19

ymmt2005 opened this issue Nov 2, 2018 · 2 comments

Comments

@ymmt2005
Copy link
Member

ymmt2005 commented Nov 2, 2018

golang/go#25805

This library uses string([]rune(s)) technique to remove invalid Unicode characters
in multiple places. They should be replaced with strings.ToValidUTF8 which will
be added in Go 1.13.

$ git grep '\[\]rune'
json.go:                        t = string([]rune(t))
json.go:                        s = string([]rune(s))
logfmt.go:                      t = string([]rune(t))
logfmt.go:                      s = string([]rune(s))
plain.go:                       t = string([]rune(t))
plain.go:                       s = string([]rune(s))
@ymmt2005 ymmt2005 changed the title [ToDo] Use strings.ToValidUTF8 added in Go 1.12 [ToDo] Use strings.ToValidUTF8 to be added in Go 1.12 Nov 2, 2018
@ymmt2005 ymmt2005 changed the title [ToDo] Use strings.ToValidUTF8 to be added in Go 1.12 [ToDo] Use forthcoming strings.ToValidUTF8 Nov 2, 2018
@ymmt2005
Copy link
Member Author

ymmt2005 commented May 3, 2019

strings.ToValidUTF8 will be added to Go 1.13
golang/go@3259bc4

@Hsn723
Copy link
Member

Hsn723 commented Mar 19, 2020

Closing as this was implemented in #26 and released as v1.6.0

@Hsn723 Hsn723 closed this as completed Mar 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants