首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C语言 >

为什么小弟我的iconv出错

2013-07-16 
为什么我的iconv出错今天装了个libiconv-1.14.tar.gz但运行iconv(cd,NULL,NULL,NULL,NULL)的时候, 总是报

为什么我的iconv出错
今天装了个libiconv-1.14.tar.gz
但运行iconv(cd,NULL,NULL,NULL,NULL);的时候, 总是报段错误 为什么呢?


int transcode(const char *from_code, const char *to_code, const char *src, int src_size, char* dest, int dest_size)
{
if (dest_size < src_size || dest_size <= 0 || src_size<=0)
return -1;

iconv_t cd;

cd = iconv_open(to_code, from_code);
iconv(cd,NULL,NULL,NULL,NULL);
    cout<<"11111"<<endl;
while (i_size > 0)
{
}
iconv_close(cd);

return strlen(dest);
}


编译的时候 能编译过去, 就是运行的时候段错误, 有人知道为什么么?
[解决办法]
你看你给的要转码的编码名字的大小写 对这个是敏感的

热点排行