Reputation: 4355
I have a JSON file in the assets folder which contains some data with spanish characters.
{
"fields": [
{
"name" : "NÚMERO DE REFERENCIA",
"type": "numeric"
},
{
"name" : "FECHA DE VENCIMIENTO",
"type": "date"
},
{
"name" : "MONTO",
"type": "money"
},
]
}
I read the first "name" : "NÚMERO DE REFERENCIA"
, using:
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream, "ISO-8859-1"));
But I get the character "Ò".
I have tested using "ISO-8859-1", but worse, I get a "?" symbol.
Someone can help me?
Thanks in advance
Upvotes: 1
Views: 868
Reputation: 43023
Change the character encoding of your file to UTF-8
.
And then just read your file like that, without specifying the encoding:
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream));
Upvotes: 2