0

I have a json file named data.json with data as

"data": {
        "val1": "568.000188",
        "val2": "Réunion..Ãland Islands,rrrß"
      },

But when I am trying to read the file as

var result = require(data.json);

I am getting result as below

"data": {
        "val1": "568.000188",
        "val2": "Réunion..�land Islands,rrr�"
      },

Can any one suggest me,how to read the file,so that I'll get exact result?

Thanks

Bikash Kumar
  • 35
  • 1
  • 8
  • What writes the JSON file? Because clearly, this is already broken. – Tomalak Sep 28 '17 at 14:29
  • 2
    Also, don't `require()` JSON files. It might look like it works, but it's a bad idea. See https://stackoverflow.com/a/25710749/18771 – Tomalak Sep 28 '17 at 14:35

0 Answers0