Home > English > Developing Windows 8 – Encoding

Developing Windows 8 – Encoding

Just wanted to address an issue I received when submitting an application for the Windows 8 application store.  Hopefully, if you follow this, you will not receive an error during your submission.

If you are using any third party JavaScript libraries or libraries that include HTML or CSS, you will more than likely run into issues where encoding of those files does not match the requirement for Windows 8 applications.  If you run the Windows 8 application validation tool, you will run into the following exception:

File encoding


UTF-8 file encoding
  • Error Found: The UTF-8 file encoding test detected the following errors:
    • File …\codemirror.js is not properly UTF-8 encoded. Re-save the file as UTF-8 (including Byte Order Mark).
    • File …\css.css is not properly UTF-8 encoded. Re-save the file as UTF-8 (including Byte Order Mark).
    • File …\index.html is not properly UTF-8 encoded. Re-save the file as UTF-8 (including Byte Order Mark).
  • Impact if not fixed: HTML, CSS, and JavaScript files must be encoded in UTF-8 form with a corresponding byte-order mark (BOM) in order to benefit from bytecode caching and to avoid other runtime error conditions.
  • How to fix: Open the affected file, and select “Save As…” option from the File menu in Visual Studio. Select the drop-down control next to the Save button and select “Save with Encoding”… option. From the Advanced save options dialog, choose the “Unicode (UTF-8 with signature)” option and click the OK button.

As stated above, this can easily be mitigated by changing the encoding the file at question using the following steps:

  1. On the File menu select the Advanced Save Options…
  2. In the dialog window you will see the current Encoding as well as Line Endings.
  3. Click on the Encoding drop-down and select Unicode (UTF-8 with Signature) – Codepage 65001.
  4. Finally, save your file.

That is all there is to it!  By doing this you will prevent getting any validation errors that deals with encoding.  So far, every JavaScript library that I have found has given me this issue.  I really want to give the validation tool provided by Microsoft kudos as it really helps troubleshoot your issues.

One last thing to point out, you may also receive an error under the Performance test that is actually related to the encoding issue.  I would first correct the Encoding issue and the re-run the validation test to see if the Performance test failure is accurate.

Hope this helps…

Categories: English Tags: , , , ,
  1. November 12, 2012 at 7:43 am

    Great tip matt. Thanx for spotting it.

  2. July 18, 2013 at 10:20 am

    Reblogged this on gifttrapratama and commented:
    nice one! you help me much in submitting my apps to store! thank you!

  3. July 18, 2013 at 10:21 am

    thanks brother! you help me much!

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: