Question

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

Was it helpful?

Solution

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));
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top