Question

I have a database which is encoded with Base64. I am getting data from that DB and i use it in my android layouts. When there is Cyrillic encrypted text, all i am getting is a question mark in a rhombus. I am using standard function to decode and it is working properly with Latin characters.

public String decrypt(String text)
{
    String result;

    result = new String( Base64.decode( text, Base64.NO_WRAP ) );

    return result;
}

What should i change to get the Cyrillic output?

Was it helpful?

Solution

You'll want to do:

result= new String( Base64.decode( text, Base64.DEFAULT ), "ISO-8859-5" );

Please change ISO-8859-5 to suit your needs, but this should be standard cyrillic charset encoding.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top