C
chike_oji
Hello,
I am displaying data retrieved from a database as a httpresponse in a
webform.
I noticed that some characters such as the comma (,), display as
special characters in the
web browser (Internet Explorer). It displays something like $^^%
instead of a comma.
Please how can I have the browser display the comma as it is from the
database.
Please find below a sample code of the code that packages the data
responseString into a
httpresponse object for display in the browser.
Thank you.
Regards,
Chike
//Make sure the response string length is not greater than 160.
if (responseString.Length > 160)
{
responseString = responseString.Substring(0,
160);
}
// Obtain a response object
HttpResponse httpresponse = Page.Response;
byte[] buffer = Encoding.UTF8.GetBytes(responseString);
// Get a response stream and write the response to it
// httpresponse.ContentLength64 = buffer.Length;
httpresponse.ContentType = "text/plain";
httpresponse.OutputStream.Write(buffer, 0,
buffer.Length);
httpresponse.Flush(); httpresponse.Close();
}
catch (Exception exception)
{
//Console.WriteLine(exception.Message);
//Console.WriteLine(exception.StackTrace);
I am displaying data retrieved from a database as a httpresponse in a
webform.
I noticed that some characters such as the comma (,), display as
special characters in the
web browser (Internet Explorer). It displays something like $^^%
instead of a comma.
Please how can I have the browser display the comma as it is from the
database.
Please find below a sample code of the code that packages the data
responseString into a
httpresponse object for display in the browser.
Thank you.
Regards,
Chike
//Make sure the response string length is not greater than 160.
if (responseString.Length > 160)
{
responseString = responseString.Substring(0,
160);
}
// Obtain a response object
HttpResponse httpresponse = Page.Response;
byte[] buffer = Encoding.UTF8.GetBytes(responseString);
// Get a response stream and write the response to it
// httpresponse.ContentLength64 = buffer.Length;
httpresponse.ContentType = "text/plain";
httpresponse.OutputStream.Write(buffer, 0,
buffer.Length);
httpresponse.Flush(); httpresponse.Close();
}
catch (Exception exception)
{
//Console.WriteLine(exception.Message);
//Console.WriteLine(exception.StackTrace);