Skip to content

Instantly share code, notes, and snippets.

@iglesias
Created February 21, 2024 15:54
Show Gist options
  • Select an option

  • Save iglesias/5818e7f41ae1b8ea9e5d9ae9c8dfa5ab to your computer and use it in GitHub Desktop.

Select an option

Save iglesias/5818e7f41ae1b8ea9e5d9ae9c8dfa5ab to your computer and use it in GitHub Desktop.
unicode.c
#include<stdlib.h>
#include<stdio.h>
int
main ()
{
int i;
char *str = getenv ("LANG");
for (i = 0; str[i + 2] != 00; i++)
{
if ((str[i] == 'u' && str[i + 1] == 't' && str[i + 2] == 'f')
|| (str[i] == 'U' && str[i + 1] == 'T' && str[i + 2] == 'F'))
{
printf
("Unicode is supported on this terminal and U+25B3 is : \u25b3\n");
i = -1;
break;
}
}
if (i != -1)
printf ("Unicode is not supported on this terminal.");
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment