I am trying to encode the string data in Base64. I am using this code :
Byte[] url_base64=repl.getBytes("UTF-8");
String con_base64=Base64.encodeToString(url_base64, Base64.NO_WRAP);
Via this code i am getting special characters like ("/","\","\n") etc. How to ignore these special characters in base64 encoding in android.
Please help me if you have any idea about it.
Not sure if this is what you want, but
Base64.encodeToString(url_base64, Base64.NO_WRAP | Base64.URL_SAFE);
will replace "\" with "_"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With