File encoding: UTF-8 and UTF-8 BOM

Before packaging an extension, I parse the JSON manifest and update the version number. This allows me to set my version at packaging time and then use the same version when deploying to several different environments.

While parsing my manifest file, I suddenly ran into the following error:

Error occurred while updating tasks version: Error determining tasks manifest paths: SyntaxError: Unexpected token

Somehow, my code wasn’t able to open manifest file and parse the JSON in it. After reaching out to the product group I found out that this had to do with the encoding of my JSON manifest file. If the encoding is UTF-8, everything works as it’s supposed to do. My manifest had an encoding of UTF-8 BOM. BOM stands for Byte Order Mark. This is a ‘magic string’ that appears at the start of a file to signal to a reader of the file things like encoding¬†and¬†endianness (see Wikipedia for more information).

All I had to do was convert my JSON manifest file from UTF-8 BOM to UTF-8. The easiest way that I found was using Notepad++. After opening the manifest file in Notepad++, you can change the encoding of the file from the encoding menu and then save the file to disk.

Encoding in Notepad++Saving the file as UTF-8 fixed the error.

Wouter de Kort works as a lead architect and consultant. He helps organizations stay on the cutting edge of software development. Wouter focuses on DevOps. He loves solving complex problems and helping other developers to grow. Wouter authored the book DevOps on the Microsoft stack and a couple of other books. Wouter is a Microsoft MVP and an ALM Ranger. You can find him on Twitter (@wouterdekort), on his blog at and at the various conferences where Wouter speaks.


Leave a Reply

Your email address will not be published. Required fields are marked *

Post comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.