问题
I can't print the swedish letters åäö.
#include <stdio.h>
#include <stdlib.h>
int main(void){
printf("å Å | ä Ä | ö Ö");
return 0;
}
The output I get is:
├Ñ ├à | ├ñ ├ä | ├ ├û
I don't understand what is wrong. I've searched google and stackoverflow, but nothing to be found. Maybe there is something wrong with UTF-8?
Other information that might be usefull:
I'm using Windows 10 and atom.
SOLUTION
Go to:
System language settings -> Administrative language settings -> Change system locale...
Now check the following box:
[Beta: Use Unicode UTF-8 for worldwide language support]
This fixed my problem and I am now able to use UTF-8 characters.
回答1:
The Windows command window (terminal, console, whatever you call it) does support UTF-8 since several years, at least with Windows 7 based on my experiences. You need to set the code page:
mode con cp select=65001
Additionally you can set the output code page programmatically:
SetConsoleOutputCP(CP_UTF8);
来源:https://stackoverflow.com/questions/60475759/having-problems-printing-%c3%a5%c3%a4%c3%b6-%c3%91-%c3%a0-%c3%b1-%c3%a4-%c3%82-%c3%bb