Merge pull request #194 from emekoi/fix-utf8

Ensure detection of UTF-8 mode regardless of case
This commit is contained in:
Jonathan Daugherty 2020-11-08 20:39:29 -08:00 committed by GitHub
commit fd8c4def96
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -92,9 +92,9 @@ reserveTerminal variant outFd = liftIO $ do
utf8Active :: IO Bool
utf8Active = do
let vars = ["LC_ALL", "LANG", "LC_CTYPE"]
results <- catMaybes <$> mapM getEnv vars
let matches = filter ("UTF8" `isInfixOf`) results <>
filter ("UTF-8" `isInfixOf`) results
results <- map (toLower <$>) . catMaybes <$> mapM getEnv vars
let matches = filter ("utf8" `isInfixOf`) results <>
filter ("utf-8" `isInfixOf`) results
return $ not $ null matches
-- | Enable bracketed paste mode: