grit: drop Unicode BOM from Chrome messages.json
The BOM was added back in Dec 2012 [1] because it said the CWS wanted it in its files. However, I haven't seen this requirement in the last few years with my own extensions (uploaded plenty w/out BOMs and the localization still works), and our public docs [2] don't mention it. Drop the BOM to shrink (slightly) the files and to make it easier for other JSON parsers to handle this (as not all skip the BOM). Further, reading the CWS source directly indicates it is not required and is silently ignored. See CrxMessagesParserImpl.java:parse() which loads the JSON data through ManifestSanitizerUtil.sanitize(), and that ManifestSanitizerUtil.java:sanitize function simply does: // The incoming manifest may have a byte-order marker (0xFEFF) to denote // Unicode as its first character. Although it's not allowed in pure JSON, // we remove it here so parse just works if (content.charAt(0) == Constants.UNICODE_BYTE_ORDER_MARK) { content = content.substring(1); } return content; Url-1: https://codereview.chromium.org/11557029 Url-2: https://developer.chrome.com/extensions/i18n-messages Bug: 852585 Change-Id: I65f61eecb1147cd4c05f3a7a2295bef85023cb65 Reviewed-on: https://chromium-review.googlesource.com/1101239Reviewed-by:agrieve <agrieve@chromium.org> Reviewed-by:
Robert Flack <flackr@chromium.org> Commit-Queue: Mike Frysinger <vapier@chromium.org> Cr-Commit-Position: refs/heads/master@{#567387}
Showing
Please register or sign in to comment