I have a base64 string but the C # compiler says it is not valid, I get the following error:
The entry is not a valid Base 64 string because it contains a non-base 64 character, more than two fill-in characters, or an illegal character between the fill-in characters.
My code is as follows:
String s_data = "RmluYWwtUmVjaXBpZW50OiByZmM4MjI7IGd1YXJhbmFicmFzaWxAZ3VhcmFuYXN0b2NrLmNvbQ0KQWN0aW9uOiBmYWlsZWQNClN0YXR1czogNS4wLjANCkRpYWdub3N0aWMtQ29kZTogc210cDsgVGhlIGVtYWlsIGFjY291bnQgdGhhdCB5b3UgdHJpZWQgdG8gcmVhY2ggZG9lcyBub3QgZXhpc3QuIFBsZWFzZSB0cnkgZG91YmxlLWNoZWNraW5nIHRoZSByZWNpcGllbnQncyBlbWFpbCBhZGRyZXNzIGZvciB0eXBvcyBvciB1bm5lY2Vzc2FyeSBzcGFjZXMuIExlYXJuIG1vcmUgYXQgaHR0cHM6Ly9zdXBwb3J0Lmdvb2dsZS5jb20vbWFpbC8_cD1Ob1N1Y2hVc2VyIG40c29yMzk2MDY5M3dtaC4zNCAtIGdzbXRwDQpMYXN0LUF0dGVtcHQtRGF0ZTogV2VkLCAwNyBNYXIgMjAxOCAwOTo1MToxNiAtMDgwMCAoUFNUKQ0K";
byte[] data = Convert.FromBase64String(s_data);
string decodedString = Encoding.UTF8.GetString(data);
I've tested the string
of% with% on that site and it converts normally. I have already converted other data
to strings
but this is giving problem.