简体   繁体   English

如何在C中输出€符号?

[英]How to output € symbol in C?

I don't know how to output the Euro symbol in a C99 Project, I am using CLion to develop the project and I'm using MinGW as Toolchain (I don't know if that matters).我不知道如何在 C99 项目中输出欧元符号,我正在使用 CLion 开发该项目,我正在使用 MinGW 作为工具链(我不知道这是否重要)。

I already searched a lot and I can't find any answer to my problem, hope someone can help me.我已经搜索了很多,但找不到任何问题的答案,希望有人可以帮助我。

I already tried to do this我已经尝试过这样做

printf("€");
printf("\u20AC");

The output is Ôé¼ , but I'm expecting .输出是Ôé¼ ,但我期待

A simple way to do it is using the UTF-8 as native encoding.一种简单的方法是使用UTF-8作为本机编码。 Just print like this:只需像这样打印:

#include <stdio.h>

int main()
{
    printf("\xE2\x82\xAC");

    return 0;
}

You can find a useful link to Euro Sign here您可以在此处找到指向 Euro Sign 的有用链接

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM