std::isgraph asserts, how to fix?

 ̄綄美尐妖づ 提交于 2019-12-11 15:57:02

问题


Im getting the following assert when calling std::isgraph:

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

It's a unicode built on Windows platform, but the locale is reported as "c". What should I set the locale to in order to support unicode ?


回答1:


Nothing.

std::isgraph has nothing to do with Unicode.

In particular, it cannot support any character value out of the range you've mentioned.

You could pass it individual bytes of a [say, UTF-8] codepoint, sure, but that wouldn't tell you anything.

It's simply not designed for what you're trying to do.

Use a proper library like ICU instead.



来源:https://stackoverflow.com/questions/59138426/stdisgraph-asserts-how-to-fix

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!