Terminal control/Unicode output: Difference between revisions

Content added Content deleted
(→‎{{header|Ruby}}: Added Ruby entry.)
Line 130: Line 130:
</lang>
</lang>


=={{header|Ruby}}==
<lang ruby>#encoding: UTF-8 # superfluous in Ruby >1.9.3

if ENV.values_at("LC_ALL","LC_CTYPE","LANG").compact.first.include?("UTF-8")
puts "△"
else
raise "Terminal can't handle UTF-8"
end<lang>
=={{header|Tcl}}==
=={{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.
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.