Closed yin1999 closed 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.
src
1
utf8.DecodeRune()
(RuneError, 0)
(RuneError, 1)
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 :)
Fixes: #127.
As the length of
src
is larger than1
, so theutf8.DecodeRune()
will not return(RuneError, 0)
, we can just check the following case:(RuneError, 1)
to judge if there is a decode error.