JSON charset problem when sending to firebase from

2019-08-18 07:49发布

I'm saving data to firebase RTDB through JS SDK (6.3.1) using:

 firebase.initializeApp(firebaseConfig);
  var data={
      "name":"Česká republika"
  };
  var key = firebase.database().ref().child('areas').push(data).key;

There's a problem with special characters, when I view them in Firebase console. It's scary, but firebase SOMETIMES gets the characters right and sometimes doesn't. The following output was achieved only by refreshing the script (The script file is encoded in UTF-8):

firebase-output

Also sending characters in a form like \u00e9 doesn't help. They too are received sometimes nicely, sometimes not. Thanks for your ideas!

1条回答
We Are One
2楼-- · 2019-08-18 08:23

This was in issue in a downstream dependency (the JavaScript minifier), which caused encoding problems on some edge cases.

The problem has been solved in version 6.3.4 of the JavaScript SDK, so I recommend upgrading to the latest version if you encounter this problem.

查看更多
登录 后发表回答