utf8Active :: IO Bool
utf8Active = do
    let vars = ["LC_ALL", "LANG", "LC_CTYPE"]
    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:
-- http://cirw.in/blog/bracketed-paste
utf8Active :: IO Bool
utf8Active = do
    let vars = ["LC_ALL", "LANG", "LC_CTYPE"]
    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:
-- http://cirw.in/blog/bracketed-paste
utf8Active = do
    let vars = ["LC_ALL", "LANG", "LC_CTYPE"]
    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:
-- http://cirw.in/blog/bracketed-paste