Merge pull request #89 from jonbarrow/feat/updated-profanity-check2
Some checks failed
Build CI / build (push) Has been cancelled

Use `wordsEncoding` for UTF16 strings when decoding profanity words
This commit is contained in:
Larissa 2026-01-13 01:01:59 -05:00 committed by GitHub
commit c9efbc7c52
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -411,7 +411,7 @@ func handleProfanity(form url.Values, unitcd string) map[string]string {
words = string(wordsBytes)
} else {
var utf16String []uint16
if unitcd == "0" {
if wordsEncoding == "UTF-16LE" {
for i := 0; i < len(wordsBytes)/2; i++ {
utf16String = append(utf16String, binary.LittleEndian.Uint16(wordsBytes[i*2:i*2+2]))
}