Share my HttpHandler and UTF-8 hack here.
FusionCharts Forum
Home       Members    Calendar    Who's On
Welcome Guest ( Login | Register )
        



Share my HttpHandler and UTF-8 hack here. Expand / Collapse
Author
Message
Posted 1/10/2008 2:05:04 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 1/10/2008 12:40:03 PM
Posts: 4, Visits: 10
Hey ppl,

I just had an issue earlier with displaying non-English characters using httphandler and got it resolved in case you are interested.

Basically, I constructed the xml in the httphandler and i'm calling the httphandler from my javascript. The issue is for non-English characters, they became garbage. After some research, found out that we need this byte-order mark (BOM) in front of a manually constructed xml string. So in case you are doing something similar, make sure you do the following in your httphandler


String yourxml = graph-blah-graph;
Encoding Utf8 = new UTF8Encoding(true, true);
XmlTextWriter writer = new XmlTextWriter(context.Response.OutputStream, Utf8);
XmlDocument doc = new XmlDocument();
doc.LoadXml(yourxml);
doc.Save(writer);
writer.Close();


I had response encoding all setup to be utf-8 in web.config, such you would imagine that BOM will be automatically attached to the response, but it didn't. This is why you need the above code.







http://jumptree.com
Post #3747
« Prev Topic | Next Topic »


Permissions Expand / Collapse

All times are GMT -7:00, Time now is 6:22pm


Execution: 0.094.