I'm trying to print out characters like ö,ä and å with printf() in C to console. Instead I get squares with question marks inside them.
I'm using Ubuntu and I have searched a bit and tried few solutions but they didn't work.
For example this worked for me on windows but not Linux.
Code:
#include <stdio.h>
#include <locale.h>
int main()
{
setlocale(LC_ALL, "");
printf("%c\n", 'ä');
}
I've also tried using unicode but couldn't get it to work and I have discovered that if I don't include <stdio.h> printf() displays those characters just fine. But I need <stdio.h> for other functions.
Anyone knows a way to print these characters ä,ö, and å in C to the console?