Terminal control/Unicode output: Difference between revisions

Scala added
(added autohotkey implementation)
(Scala added)
Line 208:
end
</lang>
 
=={{header|Scala}}==
[[Category:Scala Implementations]]Ad hoc in the REPL:
{{libheader|Scala}}<lang Scala>scala> println(s"Unicode is supported on this terminal and U+25B3 is : \u25b3")
Unicode is supported on this terminal and U+25B3 is : △</lang>
 
=={{header|Tcl}}==
Tcl configures the standard output channel to use the system encoding by default. The system encoding is formally the encoding for use when communicating with the OS (e.g., for filenames) but is virtually always correlated with the default terminal encoding.<lang tcl># Check if we're using one of the UTF or "unicode" encodings
<lang tcl># Check if we're using one of the UTF or "unicode" encodings
if {[string match utf-* [encoding system]] || [string match *unicode* [encoding system]]} {
puts "\u25b3"
} else {
error "terminal does not support unicode (probably)"
}</lang>Note that idiomatic Tcl code would not perform such a check; it would just produce the output which would be translated as best as possible (possibly into the target encoding's placeholder character).
}</lang>
Note that idiomatic Tcl code would not perform such a check; it would just produce the output which would be translated as best as possible (possibly into the target encoding's placeholder character).
 
=={{header|UNIX Shell}}==
Anonymous user