Scintilla 支持 Unicode 吗? SCI_GETCHARAT 怎么样?
Scintilla 真的支持 Unicode 吗?如果是这样,为什么 SCI_GETCHARAT
返回 char
值(转换为LRESULT
)?
Does Scintilla really support Unicode? If so, why does SCI_GETCHARAT
return a char
value (casted to LRESULT
)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
来自 SCI_SETCODEPAGE 文档...
您必须检查使用 SCI_GETCHARAT(pos) 检索的字节,并且根据该字节的最高位,可能需要读取 SCI_GETCHARAT(pos+1) 及其他字节才能获取 Unicode 代码点。 (请参阅此处。)
编辑:
对于某些 C++执行此操作的代码,请参见下面(搜索
SciMoz::GetWCharAt
):http://vacuproj.googlecode.com/svn/trunk/npscimoz/npscimoz/oldsrc/trunk.nsSciMoz.cxx
From the SCI_SETCODEPAGE docs...
You will have to examine the byte you retrieve with SCI_GETCHARAT(pos) and, depending on the top bits of that, maybe read SCI_GETCHARAT(pos+1) and beyond in order to get the Unicode code point. (See here.)
Edit:
For some C++ code that does this, see below (search for
SciMoz::GetWCharAt
):http://vacuproj.googlecode.com/svn/trunk/npscimoz/npscimoz/oldsrc/trunk.nsSciMoz.cxx
我是很久以前的事了,但如果我没记错的话,Scintilla 并不是一个原生的 Unicode 应用程序。但它仍然有一些 Unicode 支持。
首先,函数名称应该是
SCI_GETBYTEAT
,因为它从 UTF-8 内部缓冲区返回一个字节。此外,该应用程序对键盘有 Unicode 支持,因此它有一些 Unicode 支持:)
I was long time ago but if I remember well Scintilla is not a native Unicode application. Still it has some Unicode support.
First, the function name should
SCI_GETBYTEAT
, because it returns a byte from UTF-8 internal buffer.Also, the application has Unicode support for keybaord, so it has some Unicode support :)