【问题标题】:Get file translation mode of stdout获取stdout的文件翻译模式
【发布时间】:2020-07-13 05:51:16
【问题描述】:

函数 int _setmode(int, int) 允许在 ASCII 和 UTF(宽)模式之间切换 stdout

是否有读取stdout当前翻译模式的功能?类似_getmode的功能?在 C# 中有 Console.OutputEncoding 属性。

我想将它用于可以暂时更改模式然后设置回原始模式的功能。

【问题讨论】:

    标签: file-io console-application windows-console crt widechar


    【解决方案1】:

    来自the documentation

    返回值

    如果成功,返回之前的翻译模式。

    使用返回值可以设置回原来的值。

    【讨论】:

      猜你喜欢
      • 2010-12-29
      • 2014-09-07
      • 2016-10-28
      • 2013-10-16
      • 1970-01-01
      • 1970-01-01
      • 2014-02-13
      • 1970-01-01
      • 2011-07-20
      相关资源
      最近更新 更多