-
Notifications
You must be signed in to change notification settings - Fork 0
🈂️ Unicode Support
#include <stdio.h>
#include <stdlib.h>
#include <wchar.h>
#include <locale.h>
int main()
{
const wchar_t hmm[] = L"äö";
setlocale(LC_ALL, "");
wprintf(L"%ls\n", hmm);
wprintf(L"%lc\n", hmm[0]);
wprintf(L"%i\n", wcslen(hmm));
return 0;
}
https://stackoverflow.com/questions/23915322/printing-a-smiley-using-c-in-netbeans ☺
https://stackoverflow.com/questions/50603067/using-code-page-437-and-setlocale-at-the-same-time
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <locale.h>
#include <wchar.h>
#include <time.h>
int main(void)
{
setlocale(LC_ALL, ".437");
wchar_t * smiley = L"įšįėų ☺ ☻ ♥ ♦ ♣ ♠ ♫ ☼ ► ◄ ↕ ‼ ¶ § ▬ ↨ ↑ ↓ → ← ∟ ↔ ▲ ▼ ♂ ♀ ‼";
wprintf(L"[%s]\n", smiley);
setlocale(LC_ALL, ".1251");
wchar_t * symbols = L"įšįėų ©°×";
wprintf(L"[%s]\n", symbols);
return(0);
}
#include <stdio.h>
#include <locale.h>
#ifndef __STDC_ISO_10646__
#error "Oops, our wide chars are not Unicode codepoints, sorry!"
#endif
int main()
{
int i;
setlocale(LC_ALL, "");
for (i = 0; i < 0xffff; i++) {
// Find specific character
// if ( (wchar_t)i == 'c') printf("%x - %lc\n", i, i);
printf("%x - %lc\n", i, i);
}
return 0;
}
https://docs.microsoft.com/en-us/windows/win32/intl/code-page-identifiers
setlocale(LC_ALL, "");
setlocale(LC_ALL, ".65001");
char* res = setlocale(LC_ALL, ".UTF8");
TutorialsPoint Reference for C standard library is always useful.
https://www.tutorialspoint.com/c_standard_library/index.htm
General C language overview can be found on Geeks for Geeks.
https://www.geeksforgeeks.org/c-programming-language/
Advanced In-depth book on C language.
Extreme C: Taking you to the limit in Concurrency, OOP, and the most advanced capabilities of C
Quick simplistic tutorials on C language can be found here.
https://www.tutorialspoint.com/cprogramming/index.htm
https://www.programiz.com/c-programming
Learning and Reference of C language.
Public Domain.
Also available in CC0 or MIT License.