1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-23 18:18:00 +02:00

Ctrl+C on project files

This commit is contained in:
Brian Fiete 2022-08-01 14:05:44 -04:00
parent b12ceeb625
commit 047ae9acc3
2 changed files with 74 additions and 2 deletions

View file

@ -636,6 +636,38 @@ namespace IDE
label.Append('\x02');
}
}
static String sHexUpperChars = "0123456789ABCDEF";
public static void URLEncode(StringView inStr, String outStr)
{
for (var c in inStr)
{
if ((c.IsLetterOrDigit) || (c == '-') || (c == '_') || (c == '.') || (c == '~') || (c == '/'))
{
outStr.Append(c);
}
else
{
outStr.Append('%');
outStr.Append(sHexUpperChars[(.)c>>4]);
outStr.Append(sHexUpperChars[(.)c&0xF]);
}
}
}
public static void URLDecode(StringView inStr, String outStr)
{
for (int i < inStr.Length)
{
char8 c = inStr[i];
if ((c == '%') && (i < inStr.Length-2))
{
c = (.)int32.Parse(inStr.Substring(i+1, 2), .HexNumber).GetValueOrDefault();
i += 2;
}
outStr.Append(c);
}
}
}
}