fix double decode in debugWindow

At some point `peekCString` became locale aware. This is a double
bug, since (a) `decodeString` was being applied to the result and
(b) the locale might not be UTF-8, but the string being decoded
always is.

The fix is to use `peekCAString` which bypasses the locale decode,
then continuing to do UTF-8 decode.
This commit is contained in:
brandon s allbery kf8nh 2023-06-22 06:25:56 -04:00
parent 4bdcab8bf6
commit 4a60866ea4
No known key found for this signature in database
GPG Key ID: 227EE1942B0BDB95

View File

@ -124,7 +124,7 @@ tryUTF8 :: TextProperty -> X [String]
tryUTF8 (TextProperty s enc _ _) = do
uTF8_STRING <- getAtom "UTF8_STRING"
when (enc /= uTF8_STRING) $ error "String is not UTF8_STRING"
map decodeString . splitNul <$> io (peekCString s)
map decodeString . splitNul <$> io (peekCAString s)
tryCompound :: TextProperty -> X [String]
tryCompound t@(TextProperty _ enc _ _) = do