Kiriz
V2EX  ›  问与答

win10 c++ printf 中文内容显示 U+FFFD

  •  
  •   Kiriz · Sep 29, 2018 · 2635 views
    This topic created in 2842 days ago, the information mentioned may be changed or developed.
    #include <stdio.h>
    int main()
    {
        printf("中文");
        return 0;
    }
    

    在 win10 上使用 mingw64 编译 g++ test.cpp -fexec-charset=GBK -o test active code page 为 936

    运行后输出 U+FFFD pic

    1 replies    2018-09-29 16:39:29 +08:00
    ysc3839
        1
    ysc3839  
       Sep 29, 2018 via Android
    把输出重定向到文件,发上来看看?
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3060 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 36ms · UTC 09:11 · PVG 17:11 · LAX 02:11 · JFK 05:11
    ♥ Do have faith in what you're doing.