I am sending a large string from Delphi 5 to a C# web service, and I'm having lots of trouble with Pound (£) signs. I URLEncode the string from the Delphi side (which seems to convert them to '%A3'). When it reaches the C# web services it appears as '�'. I have tried changing the encoding of the string on the C# side by using a StreamReader (shown below), but the best I can get it to do is to change to to a question mark (?).
MemoryStream mr = new MemoryStream(System.Text.Encoding.Default.GetBytes(myString));
StreamReader sr = new StreamReader(mr, System.Text.Encoding.Default);
string s = sr.ReadToEnd();
How can I get the £ signs to be interpreted correctly?
Please help!
(Further info requested)
The web service signature is:
[WebMethod]
public string ReadMyString(string PostedString)
The Delphi 5 code uses third party components/code that we've been using successfully for years, but this is the first time we've tried talking directly to C#. An outline of the code is shown below:
tmp_Str := URLEncode(myBigString);
tmp_Str := WinInetPostData(myURL, tmp_Str);
Between these two lines I have confirmed that the £ signs have been correctly converted to '%A3'.