-
-
Save chessai/97bcd114a23abf9c701b89cd9fb4eed4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Main (main) where | |
import GHC.IO.Encoding | |
import qualified Data.Char as Char | |
main :: IO () | |
main = do | |
setLocaleEncoding utf8 | |
print $ isDifferent '\4304' '\4308' | |
putStrLn $ "isLower \4304: " ++ show (Char.isLower '\4304') | |
putStrLn $ "isUpper \4308: " ++ show (Char.isUpper '\4308') | |
putStrLn $ "isDigit \4304: " ++ show (Char.isDigit '\4304') | |
putStrLn $ "isDigit \4308: " ++ show (Char.isDigit '\4308') | |
charClass :: Char -> Char | |
charClass c | |
| Char.isLower c || Char.isUpper c = 'c' | |
| Char.isDigit c = 'd' | |
| otherwise = c | |
isDifferent :: Char -> Char -> Bool | |
isDifferent a b = charClass a /= charClass b |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for ghc in "ghc865" "ghc884" "ghc8102" | |
do | |
nix-shell --pure -p haskell.compiler."$ghc" --run "echo $TERM && echo $LANG && ghc --version && ghc char_unicode_bug.hs -o Main && ./Main" | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alacritty | |
en_US.UTF-8 | |
The Glorious Glasgow Haskell Compilation System, version 8.6.5 | |
[1 of 1] Compiling Main ( char_unicode_bug.hs, char_unicode_bug.o ) | |
Linking Main ... | |
True | |
isLower ა: False | |
isUpper ე: False | |
isDigit ა: False | |
isDigit ე: False | |
alacritty | |
en_US.UTF-8 | |
The Glorious Glasgow Haskell Compilation System, version 8.8.4 | |
[1 of 1] Compiling Main ( char_unicode_bug.hs, char_unicode_bug.o ) | |
Linking Main ... | |
False | |
isLower ა: True | |
isUpper ე: False | |
isDigit ა: False | |
isDigit ე: False | |
alacritty | |
en_US.UTF-8 | |
The Glorious Glasgow Haskell Compilation System, version 8.10.2 | |
[1 of 1] Compiling Main ( char_unicode_bug.hs, char_unicode_bug.o ) | |
Linking Main ... | |
False | |
isLower ა: True | |
isUpper ე: False | |
isDigit ა: False | |
isDigit ე: False |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment