MonoTouch iPhone アプリで UTF-8 をサポートする必要があり、ANSI ではなく UTF-8 でエンコードされるようにすべてのサーバー PHP スクリプトを更新しました。
この変更によりクライアント コードが破損し、PHP スクリプトから返された文字列をシリアル化しようとすると、ServiceStack で例外がスローされます。
using (StreamReader reader = new StreamReader (webResponse.GetResponseStream (), Encoding.UTF8))
{
string responseString = reader.ReadToEnd();
myDto = JsonSerializer.DeserializeFromString (responseString, dtoType);
}
Exception: System.Runtime.Serialization.SerializationException: Type definitions should start with a '{', expecting serialized type 'UserGamesDTO', got string starting with: {"uc":"0","gma":[{"gid":"838","ui
例外は、文字列が明らかに「{」で始まっていないことを訴えているため、これは ServiceStack が UTF-8 文字列を処理できないことを意味しますか、それとも何か設定する必要がありますか?
ありがとう。