Skip to content

Commit 3d89f8c

Browse files
authored
fix(sanitizer): treat correct U+FFFD as normal character (#128)
1 parent baae867 commit 3d89f8c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/asciisanitizer/sanitizer.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ func (t *Sanitizer) Transform(dst, src []byte, atEOF bool) (nDst, nSrc int, err
4747
return
4848
}
4949
r, size := utf8.DecodeRune(src)
50-
if r == utf8.RuneError {
50+
if r == utf8.RuneError && size < 2 {
5151
if !atEOF {
5252
err = transform.ErrShortSrc
5353
return

0 commit comments

Comments
 (0)