0

PHPで開発された1つのWebサービスを呼び出しています。中国語を選択すると、WS の応答が正しくありません。他の言語では問題ありませんが、中国語の動作は異常です。

WSの出力は

{

    "response": {
        "@attributes": {
            "error": 0
        },
        "code": 200,
        "message": "success",
        "data": [
            {
                "faq_id": "4",
                "app_id": "7",
                "question": "What is the main goal for the conference?",
                "answer": "This conference is designed to review our Q3 achievements and plan our Q4 goals",
                "status": "1"
            },
            {
                "faq_id": "5",
                "app_id": "7",
                "question": "??????????????",
                "answer": "This is strictly an employee only conference.",
                "status": "1"
            },
            {
                "faq_id": "6",
                "app_id": "7",
                "question": "Where do we stay for the conference?",
                "answer": "Details on accomodations will be provided to you before the conference begins",
                "status": "1"
            }
        ]
    }

}  

そして私は"question":"我们可以得到我们的家庭会议?"代わりに期待しています"question": "??????????????",

この問題を解決するのを手伝ってください。前もって感謝します。

4

1 に答える 1

0

この簡単なコードを試してください:

編集

    $str1 = base64_encode("我们可以得到我们的家庭会议?");
    $str2 = base64_decode($str1);
    echo $str2;

これにより、文字がそのまま表示されます。したがって、質問のためにデータを(データベースから)Webサービスに送信するときに、データをエンコードして再度デコードします。問題はこれらの文字のエンコードにあるためです。

于 2013-08-30T11:37:21.430 に答える