fix-utf16-big-end小错误 (#11199)

This commit is contained in:
iamqiz 2024-04-30 22:05:28 +08:00 committed by GitHub
parent 3b9ee99a93
commit 3e72e0497f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -513,7 +513,7 @@ func GetPackageREADME(repoURL, repoHash, packageType string) (ret string) {
if 2 < len(data) {
if 255 == data[0] && 254 == data[1] {
data, _, err = transform.Bytes(textUnicode.UTF16(textUnicode.LittleEndian, textUnicode.ExpectBOM).NewDecoder(), data)
} else if 254 == data[1] && 255 == data[0] {
} else if 254 == data[0] && 255 == data[1] {
data, _, err = transform.Bytes(textUnicode.UTF16(textUnicode.BigEndian, textUnicode.ExpectBOM).NewDecoder(), data)
}
}