Hi,

I'm creating a class library which I want to use with both the .NET and
Mono runtime. Now when I run the current version (development version),
with the .NET runtime everything works fine, the application gets some
data from a game server and returns UTF7 encoded XML. However if I run
the same test using the mono framework on Windows or Linux the XML is
completely messed up.

This is what I get with the mono runtime
ь䀀?xml versionэĦက1.0в䀀 encodingэĦကutf-7в䀀
standaloneэĦကyesв䀀?юь䀀Q3Plugs.NETюь䀀Query typeэĦကstatusRequestв䀀
protocolэĦကQuake3в䀀юь䀀Server ipadressэĦက195.130.132.155в䀀 
portэĦက27960в䀀
/ю࡜脄ကRules count࡝Ȫ⁁���+BDJAAAROА䕐偁당鼀
name࡝Ȫ⁁쇻ⶎ騀+BDJAAAROА䕐兦+EJwMQFQE+AFs-Q3 1.32 linux-i386 Oct  7
2002ࡽɥ₁+-࡜脄က/rule࡞Ąᒍ+QAA-rule
name࡝Ȫ⁁穸♮ᭀ+BDJAAAROА䕐兦+EJwMQFQE+AFs-0ࡽɥ₁+-࡜脄က/rule࡞Ąᒍ+QAA-rule
name࡝Ȫ⁁苆㧣렀+BDJAAAROА䕐兦+EJwMQFQE+AFs-0ࡽɥ₁+-࡜脄က/rule࡞Ąᒍ+QAA-rule
name࡝Ȫ⁁먹���㧣렀+BDJAAAROА䕐兦+EJwMQFQE+AFs-20ࡽɥ₁+-࡜脄က/rule࡞Ąᒍ+QAA-rule
name࡝Ȫ⁁萀+BG8AAA-gametypeࡂ脄ᒏ+AAAETEElᒬ䵄摅+-AFs-3ࡽɥ₁+-࡜脄က/rule࡞Ąᒍ+QAA-rule
name࡝Ȫ⁁꫊溥���+BDJAAAROА䕐兦+EJwMQFQE+AFs-68ࡽɥ₁+-࡜脄က/rule࡞Ąᒍ+QAA-rule
name࡝Ȫ⁁鶺ꡮ矀+BDJAAAROА䕐兦+EJwMQFQE+AFs-pro-q3dm6ࡽɥ₁+-࡜脄က/rule࡞Ąᒍ+QAA-rule
name࡝Ȫ⁁뜀+BG8AAA-privateClientsࡂ脄ᒏ+AAAETEElᒬ䵄摅+-AFs-0ࡽɥ₁+-࡜脄က/rule࡞Ąᒍ+QAA-rule
 name࡝Ȫ⁁뜀+BG8AAA-hostnameࡂ脄ᒏ+AAAETEElᒬ 䵄摅+-AFs-Telenet Q3A 
TDM/PICKUP serverࡽɥ₁+-࡜脄က/rule࡞Ąᒍ+QAA-rule 
name࡝Ȫ⁁뜀+BG8AAA-maxclientsࡂ脄ᒏ+AAAETEElᒬ䵄摅+-AFs-14ࡽɥ₁+-࡜脄က/rule࡞Ąᒍ+QAA-rule
 
name࡝Ȫ⁁뜀+BG8AAA-punkbusterࡂ脄ᒏ+AAAETEElᒬ䵄摅+-AFs-0ࡽɥ₁+-࡜脄က/rule࡞Ąᒍ+QAA-rule
 
name࡝Ȫ⁁뜀+BG8AAA-maxRateࡂ脄ᒏ+AAAETEElᒬ䵄摅+-AFs-0ࡽɥ₁+-࡜脄က/rule࡞Ąᒍ+QAA-rule
 
name࡝Ȫ⁁뜀+BG8AAA-minPingࡂ脄ᒏ+AAAETEElᒬ䵄摅+-AFs-0ࡽɥ₁+-࡜脄က/rule࡞Ąᒍ+QAA-rule
 
name࡝Ȫ⁁뜀+BG8AAA-maxPingࡂ脄ᒏ+AAAETEElᒬ䵄摅+-AFs-0ࡽɥ₁+-࡜脄က/rule࡞Ąᒍ+QAA-rule
 
name࡝Ȫ⁁뜀+BG8AAA-floodProtectࡂ脄ᒏ+AAAETEElᒬ䵄摅+-AFs-0ࡽɥ₁+-࡜脄က/rule࡞Ąᒍ+QAA-rule
 
name࡝Ȫ⁁뜀+BG8AAA-allowDownloadࡂ脄ᒏ+AAAETEElᒬ䵄摅+-AFs-1ࡽɥ₁+-࡜脄က/rule࡞Ąᒍ+QAA-rule
 
name࡝Ȫ⁁뗻ま쀀+BG8AAA-ospauthࡂ脄ᒏ+AAAETEElᒬ䵄摅+-AFs-1ࡽɥ₁+-࡜脄က/rule࡞Ąᒍ+QAA-rule
 
name࡝Ȫ⁁뗻ま쀀+BG8AAA-promodeࡂ脄ᒏ+AAAETEElᒬ䵄摅+-AFs-0ࡽɥ₁+-࡜脄က/rule࡞Ąᒍ+QAA-rule
 name࡝Ȫ⁁ש㭮놻ꦰ+BDJAAAROА䕐兦+EJwMQFQE+AFs-DrPepper, FoRCe and 
Celࡽɥ₁+-࡜脄က/rule࡞Ąᒍ+QAA-rule 
name࡝Ȫ⁁ᙶ+BDJAAAROА䕐兦+EJwMQFQE+AFs-gamesࡠ脄ကtelenet.beࡽɥ₁+-࡜脄က/rule࡞Ąᒍ+QAA-rule
 
name࡝Ȫ⁁唣+BDJAAAROА䕐兦+EJwMQFQE+AFs-http://games.telenet.be/ࡽɥ₁+-࡜脄က/rule࡞Ąᒍ+QAA-rule
 
name࡝Ȫ⁁薹���맟+BDJAAAROА䕐兦+EJwMQFQE+AFs-ospࡽɥ₁+-࡜脄က/rule࡞Ąᒍ+QAA-rule
 name࡝Ȫ⁁薹���שּׂ躚+BDJAAAROА䕐兦+EJwMQFQE+AFs-OSP 
v1.03ࡽɥ₁+-࡜脄က/rule࡞Ąᒍ+QAA-rule 
name࡝Ȫ⁁䉦쭀+BG8AAA-Activeࡂ脄ᒏ+AAAETEElᒬ䵄摅+-AFs-(None)ࡽɥ₁+-࡜脄က/rule࡞Ąᒍ+QAA-rule
 
name࡝Ȫ⁁뗻ま쀀+BG8AAA-cq3ࡂ脄ᒏ+AAAETEElᒬ䵄摅+-AFs-0ࡽɥ₁+-࡜脄က/rule࡞Ąᒍ+QAA-rule
 name࡝Ȫ⁁疺꺾쟦蹰+BDJAAA- /࡞Ąᒍ+QAA-Players count࡝Ȫ⁁1ࡂ脄က 
/࡞Ąကь䀀/Queryюь䀀/Q3Plugs.NETю

When I run this with the .NET runtime I get nicely formatted XML.



Part of the code I use:

...
//Convert the stream to a string
string returnValue = new UTF7Encoding().GetString(xmlStream.ToArray());

//Close the stream
xmlStream.Close();
        
//Return the XML
return returnValue;
...     

For a complete code listing 
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/q3plugs/Q3Plugs.NET/QueryBase.cs?rev=1.4&content-type=text/vnd.viewcvs-markup

I'm using UTF7 because the bytes which 
I receive don't fit into ASCII values.

Please note this is my first C# application, so I may not understand
everything yet, ... keep it simple :p


Thnx.
Timothy.
(��b�ٚ�Yb��(��b��b��1�h���&��i��b��1�h���&�f��f��X��)ߣ����b�

Reply via email to