Terminal control/Unicode output: Difference between revisions

Content added Content deleted
(added Nemerle)
(Added Haskell)
Line 76: Line 76:
Unicode is supported on this terminal and U+25B3 is : â³
Unicode is supported on this terminal and U+25B3 is : â³
</pre>
</pre>
=={{header|Haskell}}==
<lang Haskell>import System.Environment
import Data.List
import Data.Char
import Data.Maybe


main = do
x <- mapM lookupEnv ["LANG", "LC_ALL", "LC_CTYPE"]
if any (("UTF" `isInfixOf`). map toUpper) $ catMaybes x
then putStrLn "UTF supported: \x25b3"
else putStrLn "UTF not supported"
</lang>
Output:
<pre>
UTF supported: △
</pre>
=={{header|Mathematica}}==
=={{header|Mathematica}}==
<lang Mathematica>If[StringMatchQ[$CharacterEncoding, "UTF*"], Print[FromCharacterCode[30000]], Print["UTF-8 capable terminal required"]]
<lang Mathematica>If[StringMatchQ[$CharacterEncoding, "UTF*"], Print[FromCharacterCode[30000]], Print["UTF-8 capable terminal required"]]