zebron
V2EX  ›  外包

C/C++大佬请进,有偿解决个问题。

  •  
  •   zebron · Jun 21, 2022 · 1280 views
    This topic created in 1517 days ago, the information mentioned may be changed or developed.

    C/C++大佬请进,有偿解决个问题。 问题描述:数据写入 txt ,和中文有关的保存不了,和数据有关的可以正常保存。 有意的 Base64 解码:bWFnbmV0bzIzNg==

    Supplement 1  ·  Jun 22, 2022
    [已解决] 后续有诉求再请教大佬们。
    4 replies    2022-06-22 12:06:53 +08:00
    chenzhijian
        1
    chenzhijian  
       Jun 22, 2022 via Android
    编码问题,txt 是 ANSI 格式,中文是 Unicode
    shyrock
        2
    shyrock  
       Jun 22, 2022
    txt 有 unicode 编码。
    如果 OP 是保存后再打开显示乱码,那应该可以通过修改 txt 的编码解决。
    linquan
        3
    linquan  
       Jun 22, 2022
    我遇到过 windows c++下中文写到文件结果啥都没有的问题,就是 tstring 还是 stream 的编码问题
    heqing
        4
    heqing  
       Jun 22, 2022
    直接贴出代码来看看吧
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   872 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 20:07 · PVG 04:07 · LAX 13:07 · JFK 16:07
    ♥ Do have faith in what you're doing.