test

Java code posted by karim
created at 13 May 10:38, updated at 13 May 10:38

Edit | Back
1
2
3
4
5
6
7
8
9
public static string Decode(string s)
{
MatchCollection rr = Regex.Matches(s,@"(?:=\?)([^\?]+)(?:\?B\?)([^\?]*)(?:\?=)");
string charset = rr[0].Groups[1].Value;
string data = rr[0].Groups[2].Value;
byte[] b = Convert.FromBase64String(data);
string res = Encoding.GetEncoding(charset).GetString(b);
return res;
}
322 Bytes in 2 ms with coderay