icu 和内存转换器
我想从内存中创建一个转换器。
我已经创建了 etrypoint_dat,然后从我的转换器创建了 c 文件,并将这两个结构连接在一起:
},
"", 1, 0, {
{ "ibm-5348_P100-1997", (const void *)&ibm_5348_P100_1997_cnv }
}
从我调用的代码
udata_setAppData("icupackage.dat", &ntrypoint_dat, &status); // return is good
现在我的问题: 在调用 setAppData 之后如何创建转换器?
以下不起作用:
UConverter* conv = ucnv_open("ibm-5348_P100-1997", &status);
I want to create an converter from memory.
I have created the etrypoint_dat and then the c file from my converter and joined the two struct together:
},
"", 1, 0, {
{ "ibm-5348_P100-1997", (const void *)&ibm_5348_P100_1997_cnv }
}
From the code I call
udata_setAppData("icupackage.dat", &ntrypoint_dat, &status); // return is good
Now my question:
How do I create the converter after the call fo setAppData?
The following does not work:
UConverter* conv = ucnv_open("ibm-5348_P100-1997", &status);
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我自己找到的。
两个结构之间的连接必须以这种方式命名:
then 从代码中我们可以调用:
然后:
.dat
应该被删除。为了与问题保持一致,我将其保留。I found it myself.
The connection between the two structs must be named in this way:
then from code we can call:
and then:
The
.dat
should be deleted. I leave it for consistences with the question.相反,我建议您使用模式为“static”的 pkgdata 工具,它将构建一个静态库供您链接。这另一个例子是无证且脆弱的脆弱方式。
I would instead suggest that you use the pkgdata tool with mode 'static' which will build a static library for you to link. This other example is the undocumented and fragile fragile way.