1
I have the following code snippets:
window.btoa(CodAcabamento) //Codifica meu código para enviar para a WebApi
string CodAcabamentoDes = Base64Decode(CodAcabamento); //Decodifica meu código para realizar buscas no bd
public static string Base64Decode(string base64EncodedData)
{
var base64EncodedBytes = System.Convert.FromBase64String(base64EncodedData);
return System.Text.Encoding.UTF8.GetString(base64EncodedBytes);
}
But the Base64Decode
does not consider the Ç
, is problem with the Base
I’m using or some other problem?
Example of how this in the Database:
Supplementary information:
It was necessary to use the Base64
, due to the fact that I use Route
and some code receive /
, trouble.
I don’t understand why Base64
– Leandro Angelo
Sorry, that part who did was a colleague of service, because they have some codes that have special characters and was giving me trouble, according to my colleague it was necessary
– Jeff Henrique
Show an example of how the string is in the database
– Leandro Angelo
I added in the question @Leandroangelo
– Jeff Henrique
The correct one would not use base 64, if you are passing special characters on the route via GET you need to do is an Encode and Decode URL (on account of the
/
)– Leandro Angelo
There’s no way to know the error without understanding what the method does
Base64Decode
– Jéf Bueno
Ah, sorry, I forgot to post the @LINQ method
– Jeff Henrique
@Leandroangelo I will research how I can do this and try to change
– Jeff Henrique
@Jeffhenrique I’ll write a reply.
– Jéf Bueno
Okay. I’m on hold
– Jeff Henrique
Base64 as applied has no meaning (at least for me), I suppose Base64 is for avoid losses when transporting BINARY and only data, such as image content. If the idea is to create an Ids that are not numbers for your Urls it would be better to use something like GUID
– Guilherme Nascimento