foreign characters; language translation proxy application
<p>I am working on a C# application that sends an http request to a language translation server that converts Norwegian to English and vice versa.  The translation results I'm getting back suggest that certain Norwegian characters like "Ø" are being garbled.  Stepping through the code, I found this character being garbled in the URI members of the HttpWebRequest class, so I've explicitly specified the URI (instead of just depending on HTTPWebRequest class to do it for me). But my translation result remains garbled.  I suspect that the StreamReader is the culprit now, and have tried UTF8, Unicode, ASCII encoding on a Norwegian machine but to no avail. Please advise.  Thank you in advance.  The code for the function is pasted below.</p>

<p>Other details:
Example of input content: følger;<br>
Example of translation result: ? lger;<br>
Input and output are in unicode text files.</p>

<pre><code>    public string Translate(string requestquery)
    {
        string translatedresult = "";
        Uri uri = new Uri(requestquery, true); //this appears to have solved the garbled URI

        HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uri);
        HttpWebResponse response = (HttpWebResponse)request.GetResponse();
        string charSet = response.CharacterSet;


        Stream ReceiveStream = response.GetResponseStream(); 

        //I've tried all sorts of encoding here and even changing the machine locale
        string contentEncoding = response.ContentEncoding; 
        StreamReader sr = new StreamReader(ReceiveStream, Encoding.UTF8, false);

        translatedresult = sr.ReadToEnd();
        sr.Close();


        return translatedresult;
    } 
</code></pre>
