24 lines
628 B
Text
24 lines
628 B
Text
:- module unicode_output.
|
|
:- interface.
|
|
|
|
:- import_module io.
|
|
|
|
:- pred main(io::di, io::uo) is det.
|
|
|
|
:- implementation.
|
|
|
|
:- import_module list.
|
|
:- import_module maybe.
|
|
:- import_module string.
|
|
|
|
main(!IO) :-
|
|
list.map_foldl(io.get_environment_var, ["LANG", "LC_ALL", "LC_CTYPE"], EnvValues, !IO),
|
|
( if
|
|
list.member(EnvValue, EnvValues),
|
|
EnvValue = yes(Lang),
|
|
string.sub_string_search(Lang, "UTF-8", _)
|
|
then
|
|
io.write_string("Unicode is supported on this terminal and U+25B3 is : \u25b3\n", !IO)
|
|
else
|
|
io.write_string("Unicode is not supported on this terminal.\n", !IO)
|
|
).
|