From a0be60a1b9e0aa145ac76be5adc48768318545e6 Mon Sep 17 00:00:00 2001 From: Paul Larsen Date: Sat, 7 Mar 2026 22:38:18 -0500 Subject: [PATCH] B2026-025_Unicode_removed_from_RO_menu_titles_in_treeview --- .../LibSource/RODBInterface/RODBInterface.cs | 20 ++++++++++++++++--- .../LibSource/RODBInterface/VlnXml.cs | 5 ++++- PROMS/Volian.Controls.Library/StepRTB.cs | 2 +- 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/PROMS/ReferencedObjects/LibSource/RODBInterface/RODBInterface.cs b/PROMS/ReferencedObjects/LibSource/RODBInterface/RODBInterface.cs index f6ba23fe..a92492ee 100644 --- a/PROMS/ReferencedObjects/LibSource/RODBInterface/RODBInterface.cs +++ b/PROMS/ReferencedObjects/LibSource/RODBInterface/RODBInterface.cs @@ -2186,6 +2186,20 @@ namespace RODBInterface } string xmlstr = GenerateXmlString(ro, false); + StringBuilder xmlstrTmp = new StringBuilder(); // B2026-025 prep the info field data so it will be saved correctly. + char[] chrAry = xmlstr.ToCharArray(); + foreach (int chr in chrAry) + { + if (chr > 160) + { + xmlstrTmp.Append($"\\u{(int)chr}?"); + } + else + { + xmlstrTmp.Append((char)chr); + } + } + string wraccid = null; if (ro.HasAttribute("AccPageID")) { @@ -2209,13 +2223,13 @@ namespace RODBInterface // strInsert = "INSERT INTO " + parent.GetAttribute("Table") + "( RecID, RecType, ParentID, AccPageID, ModDateTime, Info ) "; 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 + "');"; } else { 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 + "');"; } } @@ -2223,7 +2237,7 @@ namespace RODBInterface { 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 + "');"; } try diff --git a/PROMS/ReferencedObjects/LibSource/RODBInterface/VlnXml.cs b/PROMS/ReferencedObjects/LibSource/RODBInterface/VlnXml.cs index eb5f1c20..d2ddc83a 100644 --- a/PROMS/ReferencedObjects/LibSource/RODBInterface/VlnXml.cs +++ b/PROMS/ReferencedObjects/LibSource/RODBInterface/VlnXml.cs @@ -96,6 +96,7 @@ using System.IO; using System.Windows.Forms; using ROFields; using VlnStatus; +using System.Text.RegularExpressions; //using VlnProfiler; //don't forget to add VlnProfiler to the reference list namespace RODBInterface @@ -517,7 +518,9 @@ namespace RODBInterface strtmp.Append(" "); cnt++; } - 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. + if ((cnt + text.Length) > frmt2) // longer than the field length? strtmp.Append(text.Substring(0,frmt2-cnt)); else strtmp.Append(text); diff --git a/PROMS/Volian.Controls.Library/StepRTB.cs b/PROMS/Volian.Controls.Library/StepRTB.cs index 0556dbba..c0661359 100644 --- a/PROMS/Volian.Controls.Library/StepRTB.cs +++ b/PROMS/Volian.Controls.Library/StepRTB.cs @@ -1404,7 +1404,7 @@ namespace Volian.Controls.Library var pattern = @"\\u([0-9]{1,4})\?"; // RO Editor add symbols C2022 - 003 foreach (Match match in Regex.Matches(linkValue, pattern, RegexOptions.IgnoreCase)) { - linkValue = linkValue.Replace(match.Value, "\\f1 " + match.Value + " \\f0"); + linkValue = linkValue.Replace(match.Value, "\\f1 " + match.Value + "\\f0"); } linkValue = linkValue.Replace(@"{", @"\{");