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:
parent
b12ceeb625
commit
047ae9acc3
2 changed files with 74 additions and 2 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue