public void EncodingFixerExpectedExceptionTest() { byte[] bytes = new byte[] { 0xFF, 150 }; string encodingFixedString = EncodingFixer.FixQuickBaseEncoding(bytes); Assert.AreEqual(encodingFixedString, "255–"); }
public void EncodingFixerSuccessTest() { UTF8Encoding encoder = new UTF8Encoding(); byte[] bytes = encoder.GetBytes("a"); string encodingFixedString = EncodingFixer.FixQuickBaseEncoding(bytes); Assert.AreEqual(encodingFixedString, "a"); }
/// <summary> /// Parses the response string to an XmlDocument object. /// </summary> /// <param name="response">The response string.</param> /// <returns>The XmlDocument object.</returns> public static XmlDocument ParseResponseIntoXml(string response) { UTF8Encoding encoder = new UTF8Encoding(); XmlDocument respXML = new XmlDocument(); byte[] responseBytes = encoder.GetBytes(response); string quickBaseResponse = EncodingFixer.FixQuickBaseEncoding(responseBytes); respXML.LoadXml(quickBaseResponse); return(respXML); }