Skip to content

Commit

Permalink
fix(sanitizer): treat correct U+FFFD as normal character (#128)
Browse files Browse the repository at this point in the history
  • Loading branch information
yin1999 authored Aug 11, 2023
1 parent baae867 commit 3d89f8c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/asciisanitizer/sanitizer.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func (t *Sanitizer) Transform(dst, src []byte, atEOF bool) (nDst, nSrc int, err
return
}
r, size := utf8.DecodeRune(src)
if r == utf8.RuneError {
if r == utf8.RuneError && size < 2 {
if !atEOF {
err = transform.ErrShortSrc
return
Expand Down

0 comments on commit 3d89f8c

Please sign in to comment.