【问题标题】:std::isgraph asserts, how to fix?std::isgraph 断言,如何解决?
【发布时间】:2019-12-02 11:54:38
【问题描述】:

我在调用std::isgraph 时得到以下断言:

_ASSERTE(c >= -1 && c <= 255);

它是在 Windows 平台上构建的 unicode,但语言环境报告为“c”。为了支持 unicode,我应该将语言环境设置为什么?

【问题讨论】:

    标签: c++ unicode c++17 locale


    【解决方案1】:

    什么都没有。

    std::isgraph 与 Unicode 无关。

    特别是,它不支持超出您提到的范围的任何字符值。

    当然,您可以将 [比如说,UTF-8] 代码点的单个字节传递给它,但这不会告诉您任何信息。

    它根本不是为您想要做的事情而设计的。

    改用 ICU 等适当的库。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-02-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-12-03
      • 2020-07-14
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多