B2026-025_Unicode_removed_from_RO_menu_titles_in_treeview #729
Reference in New Issue
Block a user
Delete Branch "B2026-025_Unicode_removed_from_RO_menu_titles_in_treeview"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
B2026-025 Unicode removed from RO menu titles in treeview.
See notes.
@@ -2189,0 +2190,4 @@char[] chrAry = xmlstr.ToCharArray();foreach (int chr in chrAry){if (chr > 160)should this be 160 or 166?
In ctlXMLEdit.cs you have:
could be mistaken, but would think this would be consistent?
@@ -2210,3 +2224,3 @@strInsert = "INSERT INTO " + parent.GetAttribute("Table") + "( RecID, RecType, ParentID, ModDateTime, AccPageID, Info ) ";strInsert = strInsert + " VALUES ('" + ro.GetAttribute("RecID") + "'," + (uint)RecordType.Group + ",'" + ro.GetAttribute("ParentID");strInsert = strInsert + "','" + wraccid + "','" + dt + "','" + xmlstr + "');";strInsert = strInsert + "','" + wraccid + "','" + dt + "','" + xmlstrTmp + "');";Ideally, these inserts would be done a different way as concatenating SQL together like this could risk sql injection --- that being said - I believe that would be beyond the scope of this project / CSM item.
@@ -518,3 +519,3 @@cnt++;}if ((cnt + text.Length) > frmt2) // longer than the field length?// string sym = symbcode < 256 ? ((char)symbcode).ToString() : string.Format(@"\u{0}", symbcode);Should commented out code be removed?
@@ -519,2 +520,3 @@}if ((cnt + text.Length) > frmt2) // longer than the field length?// string sym = symbcode < 256 ? ((char)symbcode).ToString() : string.Format(@"\u{0}", symbcode);text = Regex.Replace(text, @"\\u([0-9]{1,4})\?", m => Convert.ToChar(int.Parse(m.Groups[1].Value)).ToString()); //B2026-025 Unicode removed from RO menu titles in treeview.Does there need to be a null check / try parse here?
see notes - let me know if you have any questions.
@@ -2146,0 +2146,4 @@char[] chrAry = xmlstr.ToCharArray();foreach (int chr in chrAry){if (chr > 160)should this be 160 or 166?
In ctlXMLEdit.cs you have:
could be mistaken, but would think this would be consistent?
@@ -2146,0 +2155,4 @@xmlstrTmp.Append((char)chr);}}string strUpdate = "UPDATE " + ro.GetAttribute("Table") + " SET Info = '" + xmlstrTmp + "'";here - it looks like you are concatenating a stringbuilder with a string --- should
this line have xmlstrTmp.ToString() instead?
Well in my testing the data was saved just fine, but I will added the tostring(). I do not think it will hurt.
@@ -2189,0 +2203,4 @@char[] chrAry = xmlstr.ToCharArray();foreach (int chr in chrAry){if (chr > 160)should this be 160 or 166?
In ctlXMLEdit.cs you have:
could be mistaken, but would think this would be consistent?
@@ -2210,3 +2237,3 @@strInsert = "INSERT INTO " + parent.GetAttribute("Table") + "( RecID, RecType, ParentID, ModDateTime, AccPageID, Info ) ";strInsert = strInsert + " VALUES ('" + ro.GetAttribute("RecID") + "'," + (uint)RecordType.Group + ",'" + ro.GetAttribute("ParentID");strInsert = strInsert + "','" + wraccid + "','" + dt + "','" + xmlstr + "');";strInsert = strInsert + "','" + wraccid + "','" + dt + "','" + xmlstrTmp + "');";here - it looks like you are concatenating a stringbuilder with a string --- should
this line have xmlstrTmp.ToString() instead?
@@ -2216,3 +2243,3 @@strInsert = "INSERT INTO " + parent.GetAttribute("Table") + "( RecID, RecType, ParentID, ModDateTime, Info ) ";strInsert = strInsert + " VALUES ('" + ro.GetAttribute("RecID") + "'," + (uint)RecordType.Group + ",'" + ro.GetAttribute("ParentID");strInsert = strInsert + "','" + dt + "','" + xmlstr + "');";strInsert = strInsert + "','" + dt + "','" + xmlstrTmp + "');";here - it looks like you are concatenating a stringbuilder with a string --- should
this line have xmlstrTmp.ToString() instead?
@@ -2224,3 +2251,3 @@strInsert = "INSERT INTO " + parent.GetAttribute("Table") + "( RecID, RecType, ParentID, AccPageId, ModDateTime, Info ) ";strInsert = strInsert + " VALUES ('" + ro.GetAttribute("RecID") + "'," + (uint)RecordType.RRO + ",'" + ro.GetAttribute("ParentID");strInsert = strInsert + "','" + wraccid + "','" + dt + "','" + xmlstr + "');";strInsert = strInsert + "','" + wraccid + "','" + dt + "','" + xmlstrTmp + "');";here - it looks like you are concatenating a stringbuilder with a string --- should
this line have xmlstrTmp.ToString() instead?
@@ -2635,0 +2662,4 @@char[] chrAry = tinfo2.ToCharArray();foreach (int chr in chrAry){if (chr > 160)should this be 160 or 166?
In ctlXMLEdit.cs you have:
could be mistaken, but would think this would be consistent?
@@ -2635,0 +2671,4 @@tinfo2Tmp.Append((char)chr);}}str = "UPDATE " + echild.GetAttribute("Table") + " SET Info = '" + tinfo2Tmp + "'";here - it looks like you are concatenating a stringbuilder with a string --- should
str = "UPDATE " + echild.GetAttribute("Table") + " SET Info = '" + tinfo2Tmp + "'";
be
str = "UPDATE " + echild.GetAttribute("Table") + " SET Info = '" + tinfo2Tmp.ToString() + "'";
?
Looks good. Ready for QA.
changes look good
Final update was put on 3/10/26. Tested with PROMS version 2.3.2603.1014 and verified no unicode symbols displayed anywhere.