Who would have known that the only way of specifying utf-8 without preamble, is to not specify encoding at all. Or 'null' when sending an Encoder.

afrisby
lbsa71 2007-07-08 07:53:48 +00:00
parent e8671a2c05
commit d6d7e2127c
3 changed files with 5 additions and 5 deletions

View File

@ -57,8 +57,8 @@ namespace Nwc.XmlRpc
{
_client = client;
_output = new StreamWriter(client.GetStream(), Encoding.UTF8 );
_input = new StreamReader(client.GetStream(), Encoding.UTF8 );
_output = new StreamWriter(client.GetStream() );
_input = new StreamReader(client.GetStream() );
GetRequestMethod();
GetRequestHeaders();

View File

@ -56,6 +56,7 @@ namespace Nwc.XmlRpc
override public Object Deserialize(TextReader xmlData)
{
XmlTextReader reader = new XmlTextReader(xmlData);
XmlRpcRequest request = new XmlRpcRequest();
bool done = false;

View File

@ -56,16 +56,15 @@ namespace Nwc.XmlRpc
{
using (MemoryStream memStream = new MemoryStream(4096))
{
XmlTextWriter xml = new XmlTextWriter(memStream, Encoding.UTF8);
XmlTextWriter xml = new XmlTextWriter( memStream, null );
xml.Formatting = Formatting.Indented;
xml.Indentation = 4;
xml.Indentation = 4;
Serialize(xml, obj);
xml.Flush();
byte[] resultBytes = memStream.ToArray();
UTF8Encoding encoder = new UTF8Encoding();
String returns = encoder.GetString( resultBytes, 0, resultBytes.Length );
xml.Close();
return returns;