Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

encoding issue: special characters (umlauts) not saved properly #1356

Closed
neelance opened this issue Nov 3, 2018 · 2 comments
Closed

encoding issue: special characters (umlauts) not saved properly #1356

neelance opened this issue Nov 3, 2018 · 2 comments

Comments

@neelance
Copy link
Contributor

neelance commented Nov 3, 2018

  • Operating System version: multiple
  • Browser version: multiple
  • Firebase SDK version:
├─┬ @firebase/app@0.3.4
│ ├── @firebase/app-types@0.3.2
│ ├─┬ @firebase/util@0.2.2
├─┬ @firebase/auth@0.7.8
│ └── @firebase/auth-types@0.3.4
├─┬ @firebase/database@0.3.6
│ ├── @firebase/database-types@0.3.2
│ ├── @firebase/logger@0.1.1
│ ├── @firebase/util@0.2.2 deduped
├─┬ @firebase/storage@0.2.3
│ ├── @firebase/storage-types@0.2.3
  • Firebase Product: database

Describe the problem

The issue is occurring for some of our users since I updated the Firebase packages some weeks ago. Unfortunately I can not reproduce it at will. What I see is that special characters like German umlauts (ä, ö, ü, ß) sometimes do not end up in the database properly but get turned into ��. For most users everything is fine, but for some it fails. Some users contact our support, other just leave our site disappointed. The issue seems to not depend on any particular browser or operating system.

I added some code to explicitly test and detect the issue:

ref.update({
  specialCharacterTest: "abc-äöüß-ä-ö-ü-ß-abc",
});

If the issue strikes, I end up with this in the database:

specialCharacterTest: "abc-�öüß�-��-��-��-��-abc"

It is notable that several umlauts in a row cause the � to appear only at the beginning and the end and only the first umlaut is not displayed.

I know that an issue without steps to reproduce is very hard to solve, but I'd still like to bring this to your attention. Maybe someone has an idea why this happens.

@neelance
Copy link
Contributor Author

I finally found the root cause: It is not Firebase's fault, but UglifyJS' which reverses code order. It only affects the code of the long polling fallback, which is why it only happened sometimes. Here is the bug for reference: mishoo/UglifyJS#3278

@panfanky
Copy link

Hi, I experience the same problem, anyone knows a workaround? I'm not aware of using any Uglify anywhere, is it a part of the SDK?
My case is described here: https://stackoverflow.com/questions/57178991/json-charset-problem-when-sending-to-firebase-from-js
Thanks!

@firebase firebase locked and limited conversation to collaborators Oct 15, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants