還注意到http://www.couchbase.com/forums/thread/gibrish-non-english-characters-using-c-client-and-coucbase-2-0-beta,但在這裏複製以供參考:
嗨Idanm
.NET客戶端存儲使用UTF-8的字符串。您是否正確地看到客戶端發送的數據,或者是管理控制檯中的混合字符串?
此外,您可以嘗試使用Newtonsoft.JSON進行Json序列化的新擴展方法。在.NET Couchbase客戶端Beta版,你會與下面的類找到Couchbase.Extensions:
public static class CouchbaseClientExtensions
{
public static bool StoreJson(this CouchbaseClient client, StoreMode storeMode, string key, object value)
{
var json = JsonConvert.SerializeObject(value);
return client.Store(storeMode, key, json);
}
public static T GetJson<T>(this CouchbaseClient client, string key) where T : class
{
var json = client.Get<string>(key);
return json == null ? null : JsonConvert.DeserializeObject<T>(json);
}
}
似乎可能在擴展的Encoding.Default.GetBytes你使用可能會錯在這裏。 ..