I'm trying to print some UTF-8 text on my program. It doesn't show up when I do the normal print function, but it did work after I used #include<fcntl.h>, #include <io.h>, setmode(_fileno(stdout), _O_U16TEXT);, and turning printf to wprintf. However, after I used those lines mentioned above, it made all of my normal print lines invisible, and only the UTF-8 texts visible. How do i fix this?
Here's my code:
#include<fcntl.h>
#include <io.h>
#include <stdio.h>
int main (){
setmode(_fileno(stdout), _O_U16TEXT);
wprintf(L"░██████╗████████╗██╗░░░██╗██████╗░███████╗███╗░░██╗████████╗ ██╗░░░██╗░█████╗░████████╗██╗███╗░░██╗░██████╗░\n");printf("\n");
wprintf(L"██╔════╝╚══██╔══╝██║░░░██║██╔══██╗██╔════╝████╗░██║╚══██╔══╝ ██║░░░██║██╔══██╗╚══██╔══╝██║████╗░██║██╔════╝░\n");printf("\n");
wprintf(L"╚█████╗░░░░██║░░░██║░░░██║██║░░██║█████╗░░██╔██╗██║░░░██║░░░ ╚██╗░██╔╝██║░░██║░░░██║░░░██║██╔██╗██║██║░░██╗░\n");printf("\n");
wprintf(L"░╚═══██╗░░░██║░░░██║░░░██║██║░░██║██╔══╝░░██║╚████║░░░██║░░░ ░╚████╔╝░██║░░██║░░░██║░░░██║██║╚████║██║░░╚██╗\n");printf("\n");
wprintf(L"██████╔╝░░░██║░░░╚██████╔╝██████╔╝███████╗██║░╚███║░░░██║░░░ ░░╚██╔╝░░╚█████╔╝░░░██║░░░██║██║░╚███║╚██████╔╝\n");printf("\n");
wprintf(L"╚═╝░░░░╚═════╝░╚═════╝░╚══════╝╚═╝░░╚══╝░░░╚═╝░░░ ░░░╚═╝░░░░╚════╝░░░░╚═╝░░░╚═╝╚═╝░░╚══╝░╚═════╝░\n");printf("\n");
wprintf(L"░██████╗██╗░░░██╗░██████╗████████╗███████╗███╗░░░███╗\n");printf("\n");
wprintf(L"██╔════╝╚██╗░██╔╝██╔════╝╚══██╔══╝██╔════╝████╗░████║\n");printf("\n");
wprintf(L"╚█████╗░░╚████╔╝░╚█████╗░░░░██║░░░█████╗░░██╔████╔██║\n");printf("\n");
wprintf(L"░╚═══██╗░░╚██╔╝░░░╚═══██╗░░░██║░░░██╔══╝░░██║╚██╔╝██║\n");printf("\n");
wprintf(L"██████╔╝░░░██║░░░██████╔╝░░░██║░░░███████╗██║░╚═╝░██║\n");printf("\n");
wprintf(L"╚═════╝░░░░╚═╝░░░╚═════╝░░░░╚═╝░░░╚══════╝╚═╝░░░░░╚═╝\n");printf("\n");
printf("THIS BECOMES INVISIBLE");
printf("how do i make it visible???");
return;
}
Thank you!