日期:2014-05-20  浏览次数:21018 次

json 解析时有特殊符号 报错
地址是http://api.flickr.com/services/rest/?method=flickr.photos.search&api_key=96e3cd93b482b82c5acacff05d77fdab&text=android&page=1&per_page=10&format=json&nojsoncallback=1
有特殊符号 "  \ 
到这一行代码就报错了
        FlickrResponse flickrResponse = mGson.fromJson(jsonString, FlickrResponse.class);

------解决方案--------------------
里面是Unicode吧,转义一下就行了
------解决方案--------------------
没有jar 环境, js 测试没有问题。
var data = {
    "photos": {
        "page": 1,
        "pages": 47970,
        "perpage": 10,
        "total": "479693",
        "photo": [{
            "id": "10468633035",
            "owner": "95969298@N04",
            "secret": "37591f8bed",
            "server": "3730",
            "farm": 4,
            "title": "Mantano Ebook Reader Premium v2.4.3",
            "ispublic": 1,
            "isfriend": 0,
            "isfamily": 0
        },
        {
            "id": "10468549916",
            "owner": "91787793@N08",
            "secret": "0af7414c50",
            "server": "7395",
            "farm": 8,
            "title": "Invite my pin BB #invite #promote #android #BBM #BBMforAndroid #me #like4like",
            "ispublic": 1,
            "isfriend": 0,
            "isfamily": 0
        },
        {
            "id": "10468472424",
            "owner": "95969298@N04",
            "secret": "30cdd786b8",
            "server": "2805",
            "farm": 3,
            "title": "Kingdom Builder v1.0.1",
            "ispublic": 1,
            "isfriend": 0,
            "isfamily": 0
        },
        {
            "id": "10468406154",
            "owner": "106116799@N08",
            "secret": "974156d399",
            "server": "5474",
            "farm": 6,
            "title": "#1: Dragon Touch\u00ae 7\u201d Blue Dual Core Y88 Google Android 4.1 Tablet PC, Dual Camera, HD 1024\u00d7600, Google Play Pre-load, HDMI, 3D Game Supported (enhanced version of A13) [By TabletExpress]",
            "ispublic": 1,
            "isfriend": 0,
            "isfamily": 0
        },
        {