对字符编码问题,这里给出ice的策略

对字符编码问题,这里给出ice的策略:
#1 Narrow strings (that is, strings mapped to std::string) are presented to
the application in UTF-8 encoding and, similarly, the application is expected
to provide narrow strings in UTF-8 encoding to the Ice run time for transmission.

首先以8位为一个字节的字符格式,例如ascii,gbk,等,就是能在std::string下正常显示的,ice要求用户自己提供从他们自己的平台语言转换为utf8的方法

当然ascii天生兼容utf8,这个不用转.

比如我们的情况,中文版win,用的gbk,那么咱们用ice的时候要提供一个方法,把字符从gbk转换为utf8.


#2 Wide strings (that is, strings mapped to std::wstring) are automatically
encoded as Unicode by the Ice run time as appropriate for the platform. For
example, for Windows, the Ice run time converts between UTF-8 and UTF-16
in little-endian representation whereas, for Linux, the Ice run time converts
between UTF-8 and UTF-32 in the endian-ness appropriate for the host CPU.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值