RosettaCodeData/Task/Terminal-control-Unicode-output/Jq/terminal-control-unicode-output.jq
2017-09-25 22:28:19 +02:00

15 lines
393 B
Text

def has_unicode_support:
def utf: if . == null then false else contains("UTF") or contains("utf") end;
env.LC_ALL
| if utf then true
elif . != null and . != "" then false
elif env.LC_CTYPE | utf then true
else env.LANG | utf
end ;
def task:
if has_unicode_support then "\u25b3"
else error("HW65001 This program requires a Unicode-compatible terminal")
end ;
task