![]() ![]() Response.Content = encoding.GetString(response. ![]() Request.OnBeforeDeserialization = response =>Įncoding encoding = Encoding.GetEncoding("ISO-8859-1") Request.AddParameter("sku", sku, ParameterType.UrlSegment) Var request = new RestRequest("api/v2/product/", Method.GET) Cannot be used as client connection character set. public Product GetProductDetails(string sku) With this character set setting, Firebird is unable to perform conversion operations like UPPER() correctly on anything other than the standard 26 Latin letters. In order to avoid having to decode the response in your code after each time it’s called you can use the OnBeforeDeserialization function on the request to automatically convert the bytes correctly before the response is deserialized. ![]() It doesn’t seem possible to set the encoding on the RestClient, though it is possible to decode the RawBytes from the response properly with the expected encoding. The expected value is "name": "OASIS Silver Diamanté Toe Post Sandals" "name": "OASIS Silver Diamant� Toe Post Sandals" This means that although most characters are converted as expected, some such as accents have no match and are displayed as mystery characters. I’m currently using RestSharp as a client for downloading product details, however it appears that the response from the server (which I have no control over) is encoded in a differerent character set (ISO-8859-1) than RestSharp is expecting (UTF-8). ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |