You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The JSON validation test fails if Byte-Order Mark (BOM) is present in the file and throws an ambiguous error. The validation test should be updated to warn the user to take corrective action to remove BOM. It is recommended that BOM should not be used in UTF-8.
Use notepad++ or some text editor that prepends a UTF-8 BOM
Save a new workbook as UTF-8
Execute jsonValidationTest.js
Test will fail, throwing an error saying unexpected "blank" token was found
SyntaxError: Unexpected token in JSON at position 0
at TryParseJson (test/jsonValidationTest.js:149:16)
at validateJsonStringAndGetObject (test/jsonValidationTest.js:115:15)
at results.filter.forEach.file (test/jsonValidationTest.js:55:21)
at Array.forEach (<anonymous>)
at browseDirectory (test/jsonValidationTest.js:54:18)
at next (test/jsonValidationTest.js:96:31)
at /home/travis/build/Microsoft/Application-Insights-Workbooks/test/jsonValidationTest.js:102:25
at next (test/jsonValidationTest.js:96:31)
at /home/travis/build/Microsoft/Application-Insights-Workbooks/test/jsonValidationTest.js:106:21
at FSReqCallback.oncomplete (fs.js:161:5)
andrewki-msft
changed the title
Update JSON validation test to handle UTF8 BOM error
Update JSON validation test to handle UTF-8 Byte-Order Mark (BOM) error
Dec 13, 2018
The JSON validation test fails if Byte-Order Mark (BOM) is present in the file and throws an ambiguous error. The validation test should be updated to warn the user to take corrective action to remove BOM. It is recommended that BOM should not be used in UTF-8.
https://tools.ietf.org/html/rfc3629#page-6
Steps to reproduce:
jsonValidationTest.js
Fix diff for the workbook to remove the BOM:
The text was updated successfully, but these errors were encountered: