Skip to content

Commit

Permalink
[fix]add br_fix option
Browse files Browse the repository at this point in the history
  • Loading branch information
GreenDamTan committed Oct 7, 2023
1 parent ae24145 commit 6341585
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 deletions.
10 changes: 10 additions & 0 deletions SWAdmin/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,22 @@ static void Main(string[] args)
clientVer = arg;
break;
}
if (arg.Contains("fix_br"))
{
flags.fix_br = true;
break;
}
}
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
new Form1().Show();
Application.Run();
}
public static string clientVer = "default";
public struct flag
{
public bool fix_br;
}
public static flag flags;
}
}
10 changes: 7 additions & 3 deletions SWAdmin/SWWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,13 @@ public void WriteString(object writeobj, string extrname = null)
{
byte[] ss = Encoding.Unicode.GetBytes((string)writeobj);
//try temporarily fix <br> in write
string writeobjStr = Encoding.Unicode.GetString(ss);
if (writeobjStr.Contains("<br>")) {
ss = Encoding.Unicode.GetBytes(writeobjStr.Replace("<br>", "\n"));
if (Program.flags.fix_br)
{
string writeobjStr = Encoding.Unicode.GetString(ss);
if (writeobjStr.Contains("<br>"))
{
ss = Encoding.Unicode.GetBytes(writeobjStr.Replace("<br>", "\n"));
}
}
//
if (extrname != null)
Expand Down
Binary file modified SWAdmin/bin/Debug/SWAdmin.exe
Binary file not shown.
Binary file modified SWAdmin/bin/Debug/SWAdmin.pdb
Binary file not shown.

0 comments on commit 6341585

Please sign in to comment.