LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
12
返回列表 发新帖
楼主: nait

大家一般用什么解析xml?

[复制链接]
发表于 2005-10-20 07:28:10 | 显示全部楼层
to: Linux_Lyb
这个是因为libxml采用了utf8的编码。
我在实际中,遇到的问题是写入磁盘之后是乱码,它就是不写中文呀。
还没有解决。
回复 支持 反对

使用道具 举报

发表于 2005-10-20 18:50:37 | 显示全部楼层
我知道它将所有编码都转换成utf-8来使用,不过下面的语句就会出错,无论你的中文是什么编码
std::cout << "  Attribute " << attribute->get_name() << " = " << attribute->get_value() << std::endl;
我把它改为
std::cout << "  Attribute " << string(attribute->get_name()) << " = " << string(attribute->get_value()) << std::endl;
就不会出现conver错误,能正常输出
回复 支持 反对

使用道具 举报

发表于 2005-10-20 21:56:01 | 显示全部楼层
...
use libiconv to convert UTF-8 to the locale charset
回复 支持 反对

使用道具 举报

发表于 2005-10-21 13:05:04 | 显示全部楼层
Post by lzlz
...
use libiconv to convert UTF-8 to the locale charset


我的locale charset 就是 utf-8
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表