diff --git a/350-UTILITIES/Parser/XMLtoJSON_utility/XMLtoJSON_utility/Default.aspx.cs b/350-UTILITIES/Parser/XMLtoJSON_utility/XMLtoJSON_utility/Default.aspx.cs index 2cd6201..4cb3bc1 100644 --- a/350-UTILITIES/Parser/XMLtoJSON_utility/XMLtoJSON_utility/Default.aspx.cs +++ b/350-UTILITIES/Parser/XMLtoJSON_utility/XMLtoJSON_utility/Default.aspx.cs @@ -35,7 +35,11 @@ namespace XMLtoJSON_utility FileUploader.SaveAs(Server.MapPath(DefaultFileName) + FileUploader.FileName); string path = Server.MapPath("~/Upload/" + FileUploader.PostedFile.FileName); - doc.Load(path); + string encodedXml = System.Security.SecurityElement.Escape(path); + + StreamReader reader = new StreamReader(encodedXml, Encoding.ASCII); + + doc.Load(reader); txtXml.Text = doc.InnerXml; string JSON = XmlToJSON(doc); txtJson.Text = JSON; @@ -158,16 +162,16 @@ namespace XMLtoJSON_utility StringBuilder sbOut = new StringBuilder(sIn.Length); foreach (char ch in sIn) { - if (Char.IsControl(ch) || ch == '\'') - { - int ich = (int)ch; - sbOut.Append(@"\u" + ich.ToString("x4")); - continue; - } - else if (ch == '\"' || ch == '\\' || ch == '/') - { - sbOut.Append('\\'); - } + //if (Char.IsControl(ch) || ch == '\'') + //{ + // int ich = (int)ch; + // sbOut.Append(@"\u" + ich.ToString("x4")); + // continue; + //} + //else if (ch == '\"' || ch == '\\' || ch == '/') + //{ + // sbOut.Append('\\'); + //} sbOut.Append(ch); } return sbOut.ToString();