V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
Kiriz
V2EX  ›  问与答

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

  •  
  •   Kiriz · Sep 29, 2018 · 2507 views
    This topic created in 2779 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   ·   2795 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 01:49 · PVG 09:49 · LAX 18:49 · JFK 21:49
    ♥ Do have faith in what you're doing.