Skip to content

Commit

Permalink
Profile name Decode error Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
LIPtoH committed Jun 28, 2021
1 parent 2bf6e3b commit 61a7d1a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
12 changes: 4 additions & 8 deletions TS SE Tool/CustomClasses/Save/SaveFileProfileData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -402,18 +402,14 @@ public void Prepare(string[] _FileLines)

if (chunkOfline[2].StartsWith("\"") && chunkOfline[2].EndsWith("\""))
{
string compNameH = chunkOfline[2].Substring(1, chunkOfline[2].Length - 2);
string tmp = chunkOfline[2].Remove(chunkOfline[2].Length - 1, 1).Remove(0, 1);

if (compNameH.Contains("\\x"))
result = Utilities.TextUtilities.FromHexToString(string.Join("", compNameH.Split(new string[] { "\\x" }, StringSplitOptions.RemoveEmptyEntries)));

if (result == null)
result = System.Text.RegularExpressions.Regex.Unescape(compNameH);
result = Utilities.TextUtilities.FromUtfHexToString(tmp);
}

ProfileName = (result == null) ? chunkOfline[2] : result;
ProfileName = (result == "") ? chunkOfline[2] : result;

continue;
continue;
}

if (_FileLines[line].StartsWith(" creation_time:"))
Expand Down
2 changes: 1 addition & 1 deletion TS SE Tool/CustomClasses/Utilities/TextUtilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public static string FromUtfHexToString(string _input)
i--;
}
}
else
else
result += _input[i];
}

Expand Down

0 comments on commit 61a7d1a

Please sign in to comment.