Skip to content

Commit 33f0f49

Browse files
author
Gusted
committed
Don't treat BOM escape sequence as hidden character. (go-gitea#18909)
Backport go-gitea#18909
1 parent 6039138 commit 33f0f49

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

modules/charset/escape.go

Lines changed: 2 additions & 1 deletion
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)