Thank you for reporting this. I will update the EncodeXMLrpc function in the next RTC Update to include the >, " and ' characters as well. But I see that you are escaping the ' character as
&aposs; (with 2 s) instead of
' (only 1 s), which could cause problems with some XML decoders. Here is the updated XML Encoder function:
function EncodeXMLrpc(const s:RtcString):RtcString;
var
a,b:integer;
begin
Result:='';
b:=length(s);
for a:=1 to length(s) do
case s[a] of
'<':Inc(b,3);
'>':Inc(b,3);
'&':Inc(b,4);
#39:Inc(b,5);
'"':Inc(b,5);
end;
SetLength(Result,b);
b:=1;
for a:=1 to length(s) do
case s[a] of
'<':begin
Result[b]:='&';
Result[b+1]:='l';
Result[b+2]:='t';
Result[b+3]:=';';
Inc(b,4);
end;
'>':begin
Result[b]:='&';
Result[b+1]:='g';
Result[b+2]:='t';
Result[b+3]:=';';
Inc(b,4);
end;
'&':begin
Result[b]:='&';
Result[b+1]:='a';
Result[b+2]:='m';
Result[b+3]:='p';
Result[b+4]:=';';
Inc(b,5);
end;
#39:begin
Result[b]:='&';
Result[b+1]:='a';
Result[b+2]:='p';
Result[b+3]:='o';
Result[b+4]:='s';
Result[b+5]:=';';
Inc(b,6);
end;
'"':begin
Result[b]:='&';
Result[b+1]:='q';
Result[b+2]:='u';
Result[b+3]:='o';
Result[b+4]:='t';
Result[b+5]:=';';
Inc(b,6);
end;
else
begin
Result[b]:=s[a];
Inc(b);
end;
end;
end;
PS. The XML-RPC format only specifies that the
& and
< characters have to be escaped inside strings, so the problem is actually in the C# decoder. But there's no harm in escaping the >, " and ' characters as well, if that makes RTC compatible with more XML-RPC implementations.
Best Regards,
Danijel Tkalcec