Windows 11 Firefox browser throws a parsing error when used to open utf-16 encoded Json text files.
Categories
(DevTools :: JSON Viewer, defect)
Tracking
(Not tracked)
People
(Reporter: GCUser99, Unassigned)
Details
Attachments
(1 file)
374 bytes,
application/json
|
Details |
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36 Edg/106.0.1370.52
Steps to reproduce:
Save a text file in UTF-16le or UTF-16be using Windows 11 notepad or using vbscript FileSystemObject.CreateTextFile().
Find the file created above using File Explorer, rmb click and open with Firefox browser. Or alternatively, open browser and drag-drop json text file into browser window.
Actual results:
Firefox browser opens/changes to json viewer mode.
Firefox "JSON" tab shows "SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data"
Firefox "Raw Data" tab shows the json text prefixed by two black diamond question mark characters.
Expected results:
JSON tab should show a table of json keys and values.
It works perfectly if the input json file is saved in UTF-8 format.
Comment 1•3 years ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::Widget: Win32' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
Updated•3 years ago
|
Comment 2•3 years ago
|
||
Probably a duplicate of bug 1396286.
I did add support for UTF-16, but then was told to remove it :(
Updated•3 years ago
|
Reporter | ||
Comment 4•3 years ago
|
||
utf-16 is a windows standard. Also, I can open other text file types in utf-16 such as .xml and .html using Firefox, so lack of support for utf-16 .json files seems rather inconsistent. Please reconsider... thx
Comment 5•3 years ago
|
||
- UTF-8 is the only valid JSON encoding per RFC 8259.
- Windows 11 Notepad uses UTF-8 (not UTF-16LE) as the default text encoding.
- Windows lost a power to force their way to rest of the world.
Reporter | ||
Comment 6•3 years ago
|
||
On your #3 above, I was not trying to make a political statement about windows or power - just trying to help make Firefox more robust.
Description
•