Skip to content

Commit

Permalink
[release/7.0] [wasm][debugger] Don't escape accented letters (#78217)
Browse files Browse the repository at this point in the history
* Don't need to escape special characters anymore

* backporting 78320

* Fix characters

* Removing unit tests.

* remove unused code.
  • Loading branch information
thaystg committed Nov 15, 2022
1 parent 404246b commit c38b76a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
9 changes: 4 additions & 5 deletions src/mono/wasm/debugger/BrowserDebugProxy/DebugStore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1207,11 +1207,9 @@ private static string EscapeAscii(string path)
{
switch (c)
{
case var _ when c >= 'a' && c <= 'z':
case var _ when c >= 'A' && c <= 'Z':
case var _ when char.IsDigit(c):
case var _ when char.IsLetterOrDigit(c):
case var _ when c > 255:
case var _ when c == '+' || c == ':' || c == '.' || c == '-' || c == '_' || c == '~':
case var _ when c == '+' || c == ':' || c == '.' || c == '-' || c == '_' || c == '~' || c == '´' || c == '`' || c == '^' || c == '¨':
builder.Append(c);
break;
case var _ when c == Path.DirectorySeparatorChar:
Expand All @@ -1220,13 +1218,14 @@ private static string EscapeAscii(string path)
builder.Append(c);
break;
default:
builder.Append(string.Format($"%{((int)c):X2}"));
builder.AppendFormat("%{0:X2}", (int)c);
break;
}
}
return builder.ToString();
}


internal void AddMethod(MethodInfo mi)
{
if (!this.methods.ContainsKey(mi.Token))
Expand Down
2 changes: 1 addition & 1 deletion src/mono/wasm/debugger/DebuggerTestSuite/MiscTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -964,7 +964,7 @@ await EvaluateAndCheck(
"dotnet://debugger-test-special-char-in-path.dll/test#.cs")]
[InlineData(
"DebuggerTests.CheckSNonAsciiCharactersInPath",
"dotnet://debugger-test-special-char-in-path.dll/non-ascii-test-ął.cs")]
"dotnet://debugger-test-special-char-in-path.dll/non-ascii-test-ąłÅ.cs")]
public async Task SetBreakpointInProjectWithSpecialCharactersInPath(
string classWithNamespace, string expectedFileLocation)
{
Expand Down

0 comments on commit c38b76a

Please sign in to comment.