gpt4 book ai didi

unicode - Scintilla 支持 Unicode 吗? SCI_GETCHARAT 怎么样?

转载 作者:行者123 更新时间:2023-12-02 13:52:59 24 4
gpt4 key购买 nike

Scintilla 真的支持 Unicode 吗?如果是这样,为什么 SCI_GETCHARAT 会这样?返回 char 值(转换为 LRESULT)?

最佳答案

来自SCI_SETCODEPAGE docs ...

Code page SC_CP_UTF8 (65001) sets Scintilla into Unicode mode with the document treated as a sequence of characters expressed in UTF-8. The text is converted to the platform's normal Unicode encoding before being drawn by the OS and thus can display Hebrew, Arabic, Cyrillic, and Han characters.

您必须检查使用 SCI_GETCHARAT(pos) 检索的字节,并且根据该字节的最高位,可能需要读取 SCI_GETCHARAT(pos+1) 及其他字节才能获取 Unicode 代码点。 (参见here。)

编辑:

有关执行此操作的一些 C++ 代码,请参见下文(搜索 SciMoz::GetWCharAt):

http://vacuproj.googlecode.com/svn/trunk/npscimoz/npscimoz/oldsrc/trunk.nsSciMoz.cxx

关于unicode - Scintilla 支持 Unicode 吗? SCI_GETCHARAT 怎么样?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6169088/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com