Terminal control/Unicode output: Difference between revisions

no edit summary
m (→‎{{header|Scala}}: Added the Sidef Language)
No edit summary
Line 145:
{{out}}
<pre>"Unicode is supported on this terminal and U+25B3 is : △"</pre>
 
=={{header|Common Lisp}}==
Each implementation has a different "getenv" function, to work with various implementations was created the "my-getenv" function.
<lang lisp>
(defun my-getenv (name &optional default)
#+CMU
(let ((x (assoc name ext:*environment-list*
:test #'string=)))
(if x (cdr x) default))
#-CMU
(or
#+Allegro (sys:getenv name)
#+CLISP (ext:getenv name)
#+ECL (si:getenv name)
#+SBCL (sb-unix::posix-getenv name)
#+ABCL (getenv name)
#+LISPWORKS (lispworks:environment-variable name)
default))
(if (not ( null (remove-if #'null (mapcar #'my-getenv '("LANG" "LC_ALL" "LC_CTYPE")))))
(format t "Unicode is supported on this terminal and U+25B3 is : ~a~&" (code-char #x25b3))
(format t "Unicode is not supported on this terminal.~&")
)
</lang>
{{out}}
<pre>Unicode is supported on this terminal and U+25B3 is : △</pre>
 
=={{header|Elixir}}==
Anonymous user