NewtonSoft JSON serializer and UTF8 support

c#, json, json.net

Solution

Since you're serializing to a string and not to a byte array, you're not dealing with any character encodings (like utf-8) at this stage.

You'll have to find out where it's actually converted to/from UTF-8 and fix the problem there.

Problem

I have a simple method using NewtonSoft's JSON serializer and I love it (simple, returns formatted JSON). However I can't seem to get it to properly serialize UTF8 characters (they show up as a question mark i.e. '?') that are found in strings within an object. The code I'm using is: ``` string serialized = JsonConvert.SerializeObject(obj, Newtonsoft.Json.Formatting.Indented, new JsonSerializerSettings { }); ```

Original source