Skip to content

Commit b562eae

Browse files
author
Gusted
committed
Don't treat BOM escape sequence as hidden character.
- BOM sequence is a common non-harmfull escape sequence, it shouldn't be shown as hidden character. - Follows GitHub's behavior. - Resolves #18837
1 parent 9d7a431 commit b562eae

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

modules/charset/escape.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,8 @@ readingloop:
144144
return
145145
}
146146
writePos = i + size
147-
case unicode.Is(unicode.C, r):
147+
// 65279 == BOM rune.
148+
case unicode.Is(unicode.C, r) && r != rune(65279):
148149
escaped.Escaped = true
149150
escaped.HasControls = true
150151
if writePos < i {

0 commit comments

Comments
 (0)