title: Why is JsonConvert.DeserializeObject<T> throwing a JsonReaderException?
body: <p>In my Xamarin forms project i parse JSON data which loaded from a file.
  Anyways, the JSON data is 1000% valid as i can parse it in other places it and it's already used by a Native Android Application (Java) and PHP without any problem, but somehow Xamarin fails to understands it, and it gives me this error:</p>
  
  <p>Unhandled Exception:</p>
  
  <pre><code>Newtonsoft.Json.JsonReaderException: Unexpected character encountered while parsing value: {. Path 'category', line 1, position 26.
  </code></pre>
  
  <p>Now This is my JSON data:</p>
  
  <pre><code>{"response":1,"category":{"2":{"n":"V\u00e9hicules","d":"C-Vehicules","i":"icon-car","l":{"3":{"n":"Voitures","d":"Voitures"},"4":{"n":"Motos","d":"Motos"},"6":{"n":"Nautisme","d":"Nautisme"},"7":{"n":"\u00c9quipement Auto","d":"Equipement-Auto"},"8":{"n":"\u00c9quipement Moto","d":"Equipement-Moto"},"10":{"n":"Equipement Nautisme","d":"Equipement-Nautisme"}}},"3":{"n":"Immobilier","d":"C-Immobilier","i":"icon-office","l":{"15":{"n":"Ventes immobili\u00e8res","d":"Ventes-immobilieres"},"16":{"n":"Locations","d":"Locations"},"17":{"n":"Bureaux - Commerces","d":"Bureaux-Commerces"}}},"1":{"n":"Emploi","d":"C-Emploi","i":"icon-bag","l":{"1":{"n":"Offres d'emploi","d":"Offres-d--emploi"}}},"9":{"n":"Services","d":"C-Services","i":"icon-service","l":{"18":{"n":"Prestations de services","d":"Prestations-de-services"},"19":{"n":"Cours particuliers","d":"Cours-particuliers"}}},"4":{"n":"Vacances","d":"C-Vacances","i":"icon-plane","l":{"20":{"n":"Locations de vacances","d":"Locations-de-vacances"},"21":{"n":"Chambres d'h\u00f4tes","d":"Chambres-d--hotes"},"22":{"n":"Campings","d":"Campings"}}},"7":{"n":"Loisirs","d":"C-Loisirs","i":"icon-music","l":{"24":{"n":"CD Musique","d":"CD-Musique"},"23":{"n":"DVD Films","d":"DVD-Films"},"27":{"n":"Jeux - Jouets","d":"Jeux-Jouets"},"25":{"n":"Livres","d":"Livres"},"26":{"n":"Sports","d":"Sports"}}},"5":{"n":"Maison","d":"C-Maison","i":"icon-house","l":{"36":{"n":"Accessoires","d":"Accessoires"},"28":{"n":"Ameublement","d":"Ameublement"},"30":{"n":"Arts de la table","d":"Arts-de-la-table"},"38":{"n":"B\u00e9b\u00e9","d":"Bebe"},"37":{"n":"Bijoux - Montres","d":"Bijoux-Montres"},"33":{"n":"Bricolage","d":"Bricolage"},"35":{"n":"Chaussures","d":"Chaussures"},"31":{"n":"D\u00e9coration","d":"Decoration"},"29":{"n":"Electrom\u00e9nager","d":"Electromenager"},"32":{"n":"Linge de maison","d":"Linge-de-maison"},"34":{"n":"V\u00eatements","d":"Vetements"}}},"6":{"n":"Multim\u00e9dia","d":"C-Multimedia","i":"icon-phone","l":{"40":{"n":"Consoles - Jeux vid\u00e9o","d":"Consoles-Jeux-video"},"41":{"n":"Image - Son","d":"Image-Son"},"39":{"n":"Informatique","d":"Informatique"},"42":{"n":"T\u00e9l\u00e9phonie","d":"Telephonie"}}},"8":{"n":"Mat\u00e9riel professionnel","d":"C-Materiel-professionnel","i":"icon-tool","l":{"47":{"n":"Equipements","d":"Equipements"},"43":{"n":"Mat\u00e9riel agricole","d":"Materiel-agricole"},"45":{"n":"Mat\u00e9riel BTP","d":"Materiel-BTP"},"46":{"n":"Outillage","d":"Outillage"},"48":{"n":"Restauration - caf\u00e9","d":"Restauration-cafe"},"44":{"n":"Transport","d":"Transport"}}}}}
  </code></pre>
  
  <p>And this is the line where the exception occures:</p>
  
  <pre><code>var general = JsonConvert.DeserializeObject&lt;GeneralConfig&gt;(config);
  </code></pre>
  
  <p>Update: </p>
  
  <p>I didn't put the complete JSON file, i simplified it in the example above by remove other objects next to category, The reason why i simplified it is because SO won't let put the whole JSON contents and the error message clearly shows that the problem is in here:</p>
  
  <pre><code> "category":{"2":{"n":"V\u00e9hicules",
  </code></pre>
  
  <p>Update: </p>
  
  <p>Here's the code that reads the JSON:</p>
  
  <pre><code>namespace HelloWorldApp
  {
  class Config
  {
  
      string config = "";
  
      public Config()
      {
          var assembly = typeof(MainPage).GetTypeInfo().Assembly;
          //Stream stream = assembly.GetManifestResourceStream("HelloWorldApp.Resources.configs.json");
          string[] resources = Assembly.GetExecutingAssembly().GetManifestResourceNames();
          foreach (string resource in resources)
          {
              if (resource.EndsWith(".json"))
              {
                  Stream stream = assembly.GetManifestResourceStream(resource);
                  if (stream != null)
                  {
                      using (var reader = new System.IO.StreamReader(stream))
                      {
                          config = reader.ReadToEnd();
                      }
                  }
              }
          }
  
      }
  
      public void getCategory(int id)
      {
          var general = JsonConvert.DeserializeObject&lt;GeneralConfig&gt;(config);
          var category = general.category;
          var cats = JsonConvert.DeserializeObject&lt;List&lt;CategoryConfig&gt;&gt;(config);
          foreach (var item in cats)
          {
              Console.WriteLine("Cat: " + item.n);
          }
      }
  </code></pre>
  
  <p>And here's General Config:</p>
  
  <pre><code>class GeneralConfig
  {
      public string category { get; set; }
      public int city { get; set; }
      public string brand { get; set; }
      public int model { get; set; }
  }
  </code></pre>
  
  <p>Error 2:</p>
  
  <pre><code>Newtonsoft.Json.JsonSerializationException: Cannot deserialize the current JSON array (e.g. [1,2,3]) into type 'HelloWorldApp.CategoryConfig' because the type requires a JSON object (e.g. {"name":"value"}) to deserialize correctly.
  </code></pre>
  
  <p>To fix this error either change the JSON to a JSON object (e.g. {"name":"value"}) or change the deserialized type to an array or a type that implements a collection interface (e.g. ICollection, IList) like List that can be deserialized from a JSON array. JsonArrayAttribute can also be added to the type to force it to deserialize from a JSON array.
  Path 'category', line 1, position 26.</p>