Jump to content

Terminal control/Unicode output: Difference between revisions

Added Haskell
(added Nemerle)
(Added Haskell)
Line 76:
Unicode is supported on this terminal and U+25B3 is : â³
</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}}==
<lang Mathematica>If[StringMatchQ[$CharacterEncoding, "UTF*"], Print[FromCharacterCode[30000]], Print["UTF-8 capable terminal required"]]
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.