Webextensions : localization bug in firefox for windows

Dear all,

during the migration process to Wevextensions I found an issue related
to localization:

Issue:
Localized chars in the messages.json file causes firefox to crash.

  1. Example (DE)
    ö => crash (in Germany we say “ö sagt nö”)

  2. Example (FR)
    é (acute accent + e) => crash

Solution:

  • Using javascript conversion chars:
    ö => \u00f6
    é (acute accent + e) => \u0301e

  • Inserting a 3 byte header in the JSON file = EF BB BF

Best regards

Dipl.-Ing. M. Türschmann

I use utf-8 in quite a lot of files (.js, .html, .css) and it works without the utf-8 BOM. (Sublime Text saves as UTF-8 without BOM by default, I think.)

At any rate, a misconfigured WebExtension should not be able to crash Firefox.

But this is not a place to report bugs. Do that on https://bugzilla.mozilla.org.

Hi,

without BOM by default …

I know, but this BOM behaviour is MS Windows specific. In MS Windows you
need for any file with ut8 content (html etc) the BOM, otherwise the
chars are not displayed in the way as they should appear.

I will report the bug @ https://bugzilla.mozilla.org
https://discourse.mozilla-community.org .

Best regards

That is quite the oposite of what I was saying. I’m developing on a Windows PC and I use THML, CSS and JS files with Unicode characters in them. I just saved them with sublime and it works perfectly fine for those three file types. My files do not contain the BOM.

Firefox may behave differently for the messages.json files, though.

Hi,

try it yourself.

Install web-ext and create a new addon with localized messages. You can
use the attached files to run into the problem.

Start the addon from a console : web-ext run --verbose

Best regards
Dipl.-Ing. M. Türschmann

I’m not questioning your problem (with the messages.json). I just wanted to point out, that Firefox generally reads files as utf-8 even without the BOM.

You can use the attached files

If you attached files to the e-mail, those are not visible here.

Thanks for filing bug 1364770, let’s continue the conversation there.