cli / go-gh

A Go module for interacting with gh and the GitHub API from the command line.
https://pkg.go.dev/github.com/cli/go-gh/v2
MIT License
322 stars 45 forks source link

fix(sanitizer): treat correct `U+FFFD` as normal character #128

Closed yin1999 closed 10 months ago

yin1999 commented 10 months ago

Fixes: #127.

As the length of src is larger than 1, so the utf8.DecodeRune() will not return (RuneError, 0), we can just check the following case: (RuneError, 1) to judge if there is a decode error.

yin1999 commented 10 months ago

Thanks for getting started on this fix, I left one comment that I would like to see addressed.

Thanks for the suggestion. I've applied this :)