json解析失败

是因为这个特殊符号,如何解析?

{
    "v": "2",
    "ps": "🇰🇷 韩国 使用扣十倍流量",
    "add": "jiasu3.wujiexn.cx",
    "port": 18880,
    "id": "55c5e58d-142c-43b3-aa0b-294",
    "aid": 1,
    "net": "ws",
    "type": "none",
    "host": "",
    "path": "",
    "tls": ""
}
最佳答案
str := `{
        "v": "2",
        "ps": "🇰🇷 韩国 使用扣十倍流量",
        "add": "jiasu3.wujiexn.cx",
        "port": 18880,
        "id": "55c5e58d-142c-43b3-aa0b-294",
        "aid": 1,
        "net": "ws",
        "type": "none",
        "host": "",
        "path": "",
        "tls": ""
    }`
    var tmp map[string]interface{}

    _ = json.Unmarshal([]byte(str), &tmp)

    fmt.Println(tmp)

输出

map[add:jiasu3.wujiexn.cx aid:1 host: id:55c5e58d-142c-43b3-aa0b-294 net:ws path: port:18880 ps:🇰🇷 韩国 使用扣十倍流量 tls: type:none v:2]

有什么问题?

3年前 评论
讨论数量: 2
str := `{
        "v": "2",
        "ps": "🇰🇷 韩国 使用扣十倍流量",
        "add": "jiasu3.wujiexn.cx",
        "port": 18880,
        "id": "55c5e58d-142c-43b3-aa0b-294",
        "aid": 1,
        "net": "ws",
        "type": "none",
        "host": "",
        "path": "",
        "tls": ""
    }`
    var tmp map[string]interface{}

    _ = json.Unmarshal([]byte(str), &tmp)

    fmt.Println(tmp)

输出

map[add:jiasu3.wujiexn.cx aid:1 host: id:55c5e58d-142c-43b3-aa0b-294 net:ws path: port:18880 ps:🇰🇷 韩国 使用扣十倍流量 tls: type:none v:2]

有什么问题?

3年前 评论

go 默认utf8编码,Unicode编码字符都能显示

3年前 评论

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!