WinRT information: No mapping for the Unicode character exists in the target multi-byte code page.

I am working on a new app that utilizes local JSON as well as JSON and XML results from a RESTful service. I enjoy the local JSON with Visual Studio 2013 and Windows Store app since I can bind my JSON data to my XAML to view it at design time. Saves a lot of time when it comes to spacing and determining what your UI looks like.

However, when I tried to run my app I get one of those lovely error messages.

WinRT information: No mapping for the Unicode character exists in the target multi-byte code page.

Unicode Error

WTF! Something is obviously wrong with my JSON. So I perform the following troubleshooting routines.

  1. I take the JSON and go to a online validator to ensure that is it valid. (I use JSONLint.com. It does a fine job.) It should be valid because the XAML designer shows my data, but just to be safe.
  2. Perform a Copy n Paste into my favorite text editor and copy back out.
  3. Skim through my JSON looking for ‘ or any other character that should not be in there.

All of which proves to be unsuccessful. So what do I do.

Well, apparently in Visual Studio you have the ability to save files in different formats. If you open the file in Visual Studio, then go to the File Menu and choose Advanced Save Options you can choose different file encodings. The encoding that came up for my JSON file was Western European (not sure why we are still called Western European but that is a different post).

Western European

I changed the encoding from Western European to Unicode UTF-8. Magically it worked!

Unicode UTF-8

Hopefully this will help anyone who runs into a issue similar to the one I had with Unicode.