Json-c库解析包含url的json字符串问题

json-c库会把url中的'/'转译为'\/';json

多是json-c规则里面'/'字符另有他用吧;google

只能本身编写代码处理一下:url

 1 int strdelchr(char *str, char ch)
 2 {
 3     char *p ,*q ;
 4 
 5     for(p=str,q=str; *p!='\0'; p++)
 6     {
 7         if(*p!=ch)
 8             *q++=*p;
 9     }
10     *q=*p;
11     return 0;
12 }

调用该方法:spa

1 char download_url[1024] = "http://www.google.com/xxx.xxx/";
2 strdelchr(download_url, '\\');
相关文章
相关标签/搜索