JsonFx seems to be well recommended for Unity iOS, from a search of forum posts. I just grabbed JsonFx v2.0 and noticed that just using JsonReader and JsonWriter adds System.Xml dependency Mono.Security.dll System.Xml.dll System.dll mscorlib.dll JsonFx.dll Assembly-CSharp.dll I was wondering if anyone has tried building a stripped down version of JsonFx 2.0 for use with Unity? edit: actually System.Xml.dll is pretty small. I thought it was like 1.2MB. maybe b/c i have build stripping in Pro?
NOOOOOOOO. sigh ExecutionEngineException: Attempting to JIT compile method 'JsonFx.Serialization.DataReader`1<JsonFx.Model.ModelTokenType>:Read<System.Collections.Generic.Dictionary`2<string, object>> (string)' while running with --aot-only. at NewBehaviourScript.Start () [0x00000] in <filename unknown>:0
I wrote a reply to this a week ago but it apparently didn't post. The need for System.Xml is only to support the XML Serialization attributes. If you don't need these, a build would be easy to produce which didn't have that dependency. Also there is probably a subset of the JsonFx v2 source that could be built which would be betters suited to this environment. I'm not familiar with Unity enough but there is certainly a lot of flexibility written into JsonFx v2 which is not critical to JSON serialization.
The XML dependency is a minor issue, and as you mention is is possible to strip out classes and dependencies. The real problem is that for Unity on iOS, it runs in Mono's AOT mode, which is extremely unfriendly toward serialization with Generics, particularly Generics of non-string types. After trying pretty much every serialization method available for C# on iOS, and having all of them throw JIT errors at runtime, I eventually settled on https://github.com/ServiceStack/ServiceStack.Text This has the advantage of being extremely fast, working over RPC methods as well as serializing data to PlayerPrefs. But on iOS one must use string types such as Dictionary<string,string> and List<string> for example.
I should mention that I'm the developer of JsonFx. If I knew the constraints of Mono's AOT mode, I'd be able to produce a build that was more suitable for Unity on iOS. I've seen a lot of people using JsonFx on here but I've never actually made a build specifically for Unity. If anyone has any better direction for what needs to change to make it work better on Unity, I'd be happy to try to produce a build for it.
mckamey, OK thanks for the info and for JsonFx too! Just to clarify, I think the AOT JIT Errors would arise only running under iOS player. Targeting other Unity platforms such as Win, Mac, webplayer, etc. should not have this issue.
Don't use reflection for data parsing (ie json <-> object), parse the Json manually, thats working. On AOT, these automagic reflection are severely limited as for System.XML: thats standard, most Json / tree parsers you will find in .NET rely on system xml for one or more aspects
No reflection is needed for deserialization. That is simply reading the JSON text. Reflection is typically used when serializing POCO to JSON. JsonFx doesn't rely on System.Xml for anything but the serialization attributes that are pretty commonly used. If you don't use those attributes on your model objects, then you have no need for System.Xml.dll.
Sry for waking up this old thread, but this is still a problem for me Has someone a working version of JsonFx, I get it working in editor and Webplayer but not on iOS. Beside a lot of Warnings that testing against null does't work and other small stuff, whats not really nice to have so much warning spamm, it's running in Editor, as said above. But on iOS i have 2 Problems, stripping with mscorelib is not working. And as dreamora said Object <-> Json parsing is not working. But what is working? What is needed to get a Json representation of an Object Array? I need to get some Objects with string and number propperties to Json for Device <-> Server communication, something similar to the example here: [{"name":"Jon","age":15.2,"someInt":1,"friends":["Fred","Fredine","Fredchen"]},{"name":"Jane","age":18,"someInt":3,"friends":["Franz","Franzie","Franzchen"]}] Thx for advice
Still doesn't work on the iPhone. :/ I get loads of these when trying: System.MissingMethodException: Method not found: 'Default constructor not found...ctor() of System.ComponentModel.Int32Converter'. If you have an updated/(iOS)working version, it would be..AWESOME. Thx
I never was able to get JsonFX to work [edit: on Unity iOS]. I would recommend instead, using this small library. No dependencies, open source: https://github.com/prime31/UIToolkit/blob/master/Assets/Plugins/MiniJSON.cs
Just in case people are still digging about this here's how I fixed it by creating the file Assets/link.xml with the following contents: Code (csharp): <linker> <assembly fullname="System"> <type fullname="System.ComponentModel.CharConverter" preserve="all"/> <type fullname="System.ComponentModel.ByteConverter" preserve="all"/> <type fullname="System.ComponentModel.SByteConverter" preserve="all"/> <type fullname="System.ComponentModel.Int16Converter" preserve="all"/> <type fullname="System.ComponentModel.UInt16Converter" preserve="all"/> <type fullname="System.ComponentModel.Int32Converter" preserve="all"/> <type fullname="System.ComponentModel.UInt32Converter" preserve="all"/> <type fullname="System.ComponentModel.Int64Converter" preserve="all"/> <type fullname="System.ComponentModel.UInt64Converter" preserve="all"/> <type fullname="System.ComponentModel.DoubleConverter" preserve="all"/> <type fullname="System.ComponentModel.DecimalConverter" preserve="all"/> <type fullname="System.ComponentModel.SingleConverter" preserve="all"/> </assembly> </linker> Hope it helps.
While the link.xml tip was working for me i ran into another problem. I have Build in Array of a small class. This way i can fill the array within unity. custom class is Code (csharp): [System.Serializable] public class Level { public bool locked = true; public bool played = false; public int lastPlayerPoints{get;set;} public int achievedStars{get;set;} public string sceneName; } Now the weird thing. This is iOS only and only happens on the device. I serialize the Array onApplicationPause like this: Code (csharp): void OnApplicationPause (bool pause) { Debug.Log("*** OnApplicationPause ***************************"); if(pause) { Debug.Log("*** we got to pause and want to save ***********************"); // we are in background saveLevelProgressToTextFile(1); } else { Debug.Log("*** we resume the game ***********************"); // we are in foreground again. } } void saveLevelProgressToTextFile (int world) { Debug.Log("******** saveLevelProgressToTextFile ********"); string fileName = "w"+world+"progress.txt"; // this turns a C# object into a JSON string. Debug.Log("******** fileName = " + fileName); Debug.Log("******** Checking directory to save to"); if(!Directory.Exists(Application.persistentDataPath+"/LevelProgress")){ Debug.Log("Creating LevelProgress Folder"); Directory.CreateDirectory(Application.persistentDataPath+"/LevelProgress"); } else { Debug.Log("LevelProgress Folder Exists"); } //wir öffnen einen neuen StreamWriter string fullPath = Application.persistentDataPath +"/LevelProgress/" + fileName; Debug.Log("try to save " + fullPath); Debug.Log("trying to serialize world1Levels = " + world1Levels); string levelDataJSON = JsonWriter.Serialize(world1Levels); Debug.Log("******** levelDataJSON = " + levelDataJSON); StreamWriter sw = new StreamWriter(fullPath); sw.WriteLine(levelDataJSON); sw.Flush(); sw.Close(); //damit schliessen wir den StreamWriter if(File.Exists(fullPath)){ print("File " + fileName + " written!"); } else{ Debug.LogWarning("Error writing file " + fileName); } } I am testing this with Xcode. I run the app, and hit the home Button. OnApplicationPause gets fired, serialzes, saves and all is well. I hit the app icon again, app resumes, file gets read in and desiriales. All is well. But... if i hit the home button a second time now it crashes on save. Always. XCode gives me this: Code (csharp): try to save /var/mobile/Applications/4D3BBA14-06FC-40CC-9B92-054399455623/Documents/LevelProgress/w1progress.txt (Filename: /Applications/buildAgent/work/d9c061b1c154f5ae/Runtime/ExportGenerated/iPhonePlayer-armv7/UnityEngineDebug.cpp Line: 43) trying to serialize world1Levels = Level[] (Filename: /Applications/buildAgent/work/d9c061b1c154f5ae/Runtime/ExportGenerated/iPhonePlayer-armv7/UnityEngineDebug.cpp Line: 43) System.String doesn't implement interface System.Collections.IEnumerator * Assertion: should not be reached at mini-trampolines.c:183 (lldb) I have no idea why. Only reason could be that on the first desiralisation either the class instances get messed up somehow, or their values have internal type issues. I am currently lost in the dark
I am also having this problem on iOS. Everything works fine on OSX in the editor but the application crashes when running on the device. The issue comes when I serialize. Did you happen to find any fix for it? Thanks! - Josh
I had the exact same error as well. mini-trampoline.c... I finally got fed up and started using LitJson. Added all the functionality missing from it.. and using that instead. When this project is done, I do plan on uploading my changes to the project. (When I have time to clean it up.) The main thing it is lacking is it doesn't support ignore properties. No rename property. And if I remember correctly, it serializes statics as well.. I did find this a while back: https://bitbucket.org/TowerOfBricks/jsonfx-for-unity3d/src/ They seem to have continued to work on JsonFX.. too late for me to see if they have fixed that mini-trampoline, but if any of you try it out, please report on you success/failure with this!
Does it help with the following? Code (csharp): <assembly fullname="System"> <type fullname="System.ComponentModel.ArrayConverter" preserve="all"/> <type fullname="System.ComponentModel.BaseNumberConverter" preserve="all"/> <type fullname="System.ComponentModel.BooleanConverter" preserve="all"/> <type fullname="System.ComponentModel.ByteConverter" preserve="all"/> <type fullname="System.ComponentModel.CharConverter" preserve="all"/> <type fullname="System.ComponentModel.CollectionConverter" preserve="all"/> <type fullname="System.ComponentModel.ComponentConverter" preserve="all"/> <type fullname="System.ComponentModel.CultureInfoConverter" preserve="all"/> <type fullname="System.ComponentModel.DateTimeConverter" preserve="all"/> <type fullname="System.ComponentModel.DecimalConverter" preserve="all"/> <type fullname="System.ComponentModel.DoubleConverter" preserve="all"/> <type fullname="System.ComponentModel.EnumConverter" preserve="all"/> <type fullname="System.ComponentModel.ExpandableObjectConverter" preserve="all"/> <type fullname="System.ComponentModel.Int16Converter" preserve="all"/> <type fullname="System.ComponentModel.Int32Converter" preserve="all"/> <type fullname="System.ComponentModel.Int64Converter" preserve="all"/> <type fullname="System.ComponentModel.NullableConverter" preserve="all"/> <type fullname="System.ComponentModel.SByteConverter" preserve="all"/> <type fullname="System.ComponentModel.SingleConverter" preserve="all"/> <type fullname="System.ComponentModel.StringConverter" preserve="all"/> <type fullname="System.ComponentModel.TimeSpanConverter" preserve="all"/> <type fullname="System.ComponentModel.UInt16Converter" preserve="all"/> <type fullname="System.ComponentModel.UInt32Converter" preserve="all"/> <type fullname="System.ComponentModel.UInt64Converter" preserve="all"/> </assembly> By the way, I have used LitJson in the past and the reason I switched to JsonFx was because I remember having stack problems when deserializing not-so-deeply-nested structures (like 3 or 4 levels or so). There would be an exception telling me stack stack is insufficient or something like that.
This would probably be cause LitJson serializes statics as well.. so serializing singletons ==> recursive loop. I will check with the above finding; thank you! (We still use JsonFX for reading JSON.. and: very late in this project, JsonFX refused to parse a List of int:s all of a sudden.. changing to uint worked. (ints > 0 and < 35..), so anything more stable would be..welcome. I do hope they have something better/more stable for Unity4)
Code (csharp): System.String doesn't implement interface System.Collections.IEnumerator * Assertion: should not be reached at mini-trampolines.c:183 This is a problem for us too. We're using LitJson. The problem goes away on test devices when we remove some of our log statements. Some of these statements have JsonData.ToJson() in them ( object --> string ), but we are not satisfied at all that this is the culprit because it is used throughout the project and does not appear to use reflection. Other possible culprits include the use of JsonMapper.ToObject(), however this is used fairly often and is not used in any log statements (which would make no sense). I also cannot find any use of Reflection in the class. We are continuing to test, and hoping to discover more precisely what the issues are. In the meantime, if anyone has any concrete information, that would be extremely helpful. Properly debugging this issue is nightmarish at the moment, because of the way trampolines work and the lack of solid information on the web concerning precisely what causes trampolines to be required in an AOT build. In fact, we are even confused about how trampolines are relevant at all here: since iOS requires AOT, doesn't that mean that the JIT doesn't run? And if so, how are trampolines used? Sure, they are pre-allocated at compile-time, but surely to be used at runtime the JIT must in some sense be running? Furthermore, upping the number of each type of trampoline in the AOT settings appears to have no effect whatsoever upon the issue.
At some point, we got around our trampoline-issues by removing a few calls to Debug.Log. But the crashes (mini-trampolines..) started happening in or around serialization-code, and often NOT the first time the code was run. So.. well, I am confused as well. ATM we do not have any such crash, but with the randomness of it...? :/ *fingers crossed*
How are you getting the ServiceStack.Text to compile? I see lots of error surrounding missing DataContractAttribute
People were looking for a stack trace of what happens when you try to use JsonFX with iOS.. here's what happens when I try to use the newest JsonFX dll on iOS to deserialize a large json blob to a series of nested classes using reflection: Code (csharp): Failed to deserialize JsonFx.Serialization.DeserializationException: Attempting to JIT compile method '(wrapper dynamic-method) object: (object)' while running with --aot-only. ---> System.ExecutionEngineException: Attempting to JIT compile method '(wrapper dynamic-method) object: (object)' while running with --aot-only. at System.Delegate.CreateDelegate (System.Type type, System.Object firstArgument, System.Reflection.MethodInfo method, Boolean throwOnBindFailure) [0x00000] in <filename unknown>:0 at System.Delegate.CreateDelegate (System.Type type, System.Reflection.MethodInfo method, Boolean throwOnBindFailure) [0x00000] in <filename unknown>:0 at System.Delegate.CreateDelegate (System.Type type, System.Reflection.MethodInfo method) [0x00000] in <filename unknown>:0 at System.Reflection.Emit.DynamicMethod.CreateDelegate (System.Type delegateType) [0x00000] in <filename unknown>:0 at JsonFx.CodeGen.DynamicMethodGenerator.GetPropertyGetter (System.Reflection.PropertyInfo propertyInfo) [0x00000] in <filename unknown>:0 at JsonFx.Serialization.Resolvers.MemberMap..ctor (System.Reflection.PropertyInfo propertyInfo, DataName dataName, JsonFx.Serialization.Resolvers.ValueIgnoredDelegate isIgnored) [0x00000] in <filename unknown>:0 at JsonFx.Serialization.Resolvers.ResolverCache.BuildMap (System.Type objectType, IDictionary`2 maps) [0x00000] in <filename unknown>:0 at JsonFx.Serialization.Resolvers.ResolverCache.LoadMaps (System.Type type) [0x00000] in <filename unknown>:0 at JsonFx.Model.ModelAnalyzer.ConsumeObject (IStream`1 tokens, System.Type targetType) [0x00000] in <filename unknown>:0 at JsonFx.Model.ModelAnalyzer.ConsumeValue (IStream`1 tokens, System.Type targetType) [0x00000] in <filename unknown>:0 at JsonFx.Model.ModelAnalyzer+<Analyze>d__0.MoveNext () [0x00000] in <filename unknown>:0 at JsonFx.Serialization.DataReader`1[JsonFx.Model.ModelTokenType].ReadSingle (ITextTokenizer`1 tokenizer, IEnumerable`1 tokens, System.Type targetType) [0x00000] in <filename unknown>:0 --- End of inner exception stack trace --- at JsonFx.Serialization.DataReader`1[JsonFx.Model.ModelTokenType].ReadSingle (ITextTokenizer`1 tokenizer, IEnumerable`1 tokens, System.Type targetType) [0x00000] in <filename unknown>:0 at JsonFx.Serialization.DataReader`1[JsonFx.Model.ModelTokenType].Read (System.String input, System.Type targetType) [0x00000] in <filename unknown>:0 at JSON.Deserialize (System.String input, System.Type targetType) [0x00000] in <filename unknown>:0 , 1, 0, (very very long message) Anyone have any thoughts on how to get around that? Deserialization works going from JSON->Dictionary<string, object>, but I would like to avoid that intermediary step by going directly to the objects that the JSON represents. It works great on Mac/PC, but not on iOS... I've tried the link.xml stuff mentioned elsewhere in this thread, and it doesn't seem to solve this. -Ryan
Ok, I'm facing the same problem.. and I got no clue of why it happens System.String doesn't implement interface System.Collections.IEnumerator * Assertion: should not be reached at mini-trampolines.c:183 Can't figure out any solution yet
Has anybody had the chance to figure out a solution for this? Code (csharp): System.String doesn't implement interface System.Collections.IEnumerator * Assertion: should not be reached at mini-trampolines.c:183 It seems to be very random, it just throws the exception 1-2 times every 10 game starts. Any help will be grateful!
This does not solved the bug "System.String doesn't implement interface System.Collections.IEnumerator" crash Instead just need to remove all Debug.log about the object you are going to Serialize. For example if you are going to use JsonFx to Serialize() a IDictionary or a Hashtable, avoid having Debug.log which receive IDictionary/Hashtable or its keys/values as parameter. Of course you might curios to know if whatever will Serialize is correct or not, my suggestion is to Debug.Log the result string from Serialize(). Before calling Serialize(), don't Debug.Log the object. There might be something wrong with Debug.Log in this specific case. Hope this helps.
I am trying to use the JsonFX library to parse Twitter feeds and I keep getting the error: This is the code that I'm using based on the demo: Code (CSharp): var search = JsonReader.Deserialize<TwitterSearchResults> (rawJson); And this is the rawJson text that is returned from a Twitter search: Code (CSharp): { "statuses": [ { "metadata": { "iso_language_code": "en", "result_type": "recent" }, "created_at": "Sat Dec 20 00:19:47 +0000 2014", "id": 546097597551628300, "id_str": "546097597551628289", "text": "RT @The_YUNiversity: If you want to remember what #vocabulary words mean, make as many mnemonics as possible. \n\n http://t.co/2GfszGnuNl …", "source": "<a href=\"http://twitter.com/download/android\" rel=\"nofollow\">Twitter for Android</a>", "truncated": false, "in_reply_to_status_id": null, "in_reply_to_status_id_str": null, "in_reply_to_user_id": null, "in_reply_to_user_id_str": null, "in_reply_to_screen_name": null, "user": { "id": 98570570, "id_str": "98570570", "name": "tRi3", "screen_name": "trulicious", "location": "soundcloud.com/trulicious", "profile_location": null, "description": "Just 60% from avatar. Busy being happy. Instagram: trulicious.", "url": "http://t.co/TQkoQU9o0t", "entities": { "url": { "urls": [ { "url": "http://t.co/TQkoQU9o0t", "expanded_url": "http://trulicious.tumblr.com", "display_url": "trulicious.tumblr.com", "indices": [ 0, 22 ] } ] }, "description": { "urls": [] } }, "protected": false, "followers_count": 369, "friends_count": 401, "listed_count": 7, "created_at": "Tue Dec 22 06:42:33 +0000 2009", "favourites_count": 182, "utc_offset": 25200, "time_zone": "Jakarta", "geo_enabled": false, "verified": false, "statuses_count": 30276, "lang": "en", "contributors_enabled": false, "is_translator": false, "is_translation_enabled": false, "profile_background_color": "E7E9F5", "profile_background_image_url": "http://pbs.twimg.com/profile_background_images/669628408/20a0af00a0c0f38baa59c4d9849c3bc4.jpeg", "profile_background_image_url_https": "https://pbs.twimg.com/profile_background_images/669628408/20a0af00a0c0f38baa59c4d9849c3bc4.jpeg", "profile_background_tile": false, "profile_image_url": "http://pbs.twimg.com/profile_images/542551536828555264/LPOnSXda_normal.jpeg", "profile_image_url_https": "https://pbs.twimg.com/profile_images/542551536828555264/LPOnSXda_normal.jpeg", "profile_banner_url": "https://pbs.twimg.com/profile_banners/98570570/1411423406", "profile_link_color": "2FC2EF", "profile_sidebar_border_color": "FFFFFF", "profile_sidebar_fill_color": "252429", "profile_text_color": "666666", "profile_use_background_image": true, "default_profile": false, "default_profile_image": false, "following": false, "follow_request_sent": false, "notifications": false }, "geo": null, "coordinates": null, "place": null, "contributors": null, "retweeted_status": { "metadata": { "iso_language_code": "en", "result_type": "recent" }, "created_at": "Sat Dec 20 00:00:18 +0000 2014", "id": 546092692229201900, "id_str": "546092692229201920", "text": "If you want to remember what #vocabulary words mean, make as many mnemonics as possible. \n\n http://t.co/2GfszGnuNl http://t.co/KXtW6Vc8mQ", "source": "<a href=\"https://about.twitter.com/products/tweetdeck\" rel=\"nofollow\">TweetDeck</a>", "truncated": false, "in_reply_to_status_id": null, "in_reply_to_status_id_str": null, "in_reply_to_user_id": null, "in_reply_to_user_id_str": null, "in_reply_to_screen_name": null, "user": { "id": 217477505, "id_str": "217477505", "name": "Grammar YUNiversity", "screen_name": "The_YUNiversity", "location": "Writing our book in L.A.", "profile_location": null, "description": "Grammar bosses for Gen tl;dr. @IBGDRGN is our muse; @gerardway is our hero. We love YUNicorns. | \nhttp://t.co/Jo2cKRUuNF", "url": "http://t.co/8XWGuORgVw", "entities": { "url": { "urls": [ { "url": "http://t.co/8XWGuORgVw", "expanded_url": "http://www.TheYUNiversity.net", "display_url": "TheYUNiversity.net", "indices": [ 0, 22 ] } ] }, "description": { "urls": [ { "url": "http://t.co/Jo2cKRUuNF", "expanded_url": "http://about.me/The_YUNiversity", "display_url": "about.me/The_YUNiversity", "indices": [ 98, 120 ] } ] } }, "protected": false, "followers_count": 179887, "friends_count": 389, "listed_count": 631, "created_at": "Fri Nov 19 16:49:22 +0000 2010", "favourites_count": 13741, "utc_offset": -28800, "time_zone": "Pacific Time (US & Canada)", "geo_enabled": true, "verified": false, "statuses_count": 27684, "lang": "en", "contributors_enabled": false, "is_translator": false, "is_translation_enabled": false, "profile_background_color": "FFFFFF", "profile_background_image_url": "http://pbs.twimg.com/profile_background_images/495094833438941185/6CbwwhIn.png", "profile_background_image_url_https": "https://pbs.twimg.com/profile_background_images/495094833438941185/6CbwwhIn.png", "profile_background_tile": true, "profile_image_url": "http://pbs.twimg.com/profile_images/435657778913222656/2GUwf3MP_normal.png", "profile_image_url_https": "https://pbs.twimg.com/profile_images/435657778913222656/2GUwf3MP_normal.png", "profile_banner_url": "https://pbs.twimg.com/profile_banners/217477505/1414975099", "profile_link_color": "D9002D", "profile_sidebar_border_color": "FFFFFF", "profile_sidebar_fill_color": "DDEEF6", "profile_text_color": "333333", "profile_use_background_image": false, "default_profile": false, "default_profile_image": false, "following": false, "follow_request_sent": false, "notifications": false }, "geo": null, "coordinates": null, "place": null, "contributors": null, "retweet_count": 4, "favorite_count": 8, "entities": { "hashtags": [ { "text": "vocabulary", "indices": [ 29, 40 ] } ], "symbols": [], "user_mentions": [], "urls": [ { "url": "http://t.co/2GfszGnuNl", "expanded_url": "http://bit.ly/ScexIO", "display_url": "bit.ly/ScexIO", "indices": [ 95, 117 ] }, { "url": "http://t.co/KXtW6Vc8mQ", "expanded_url": "http://twitter.com/The_YUNiversity/status/546092692229201920/photo/1", "display_url": "pic.twitter.com/KXtW6Vc8mQ", "indices": [ 118, 140 ] } ] }, "favorited": false, "retweeted": false, "possibly_sensitive": false, "lang": "en" }, "retweet_count": 4, "favorite_count": 0, "entities": { "hashtags": [ { "text": "vocabulary", "indices": [ 50, 61 ] } ], "symbols": [], "user_mentions": [ { "screen_name": "The_YUNiversity", "name": "Grammar YUNiversity", "id": 217477505, "id_str": "217477505", "indices": [ 3, 19 ] } ], "urls": [ { "url": "http://t.co/2GfszGnuNl", "expanded_url": "http://bit.ly/ScexIO", "display_url": "bit.ly/ScexIO", "indices": [ 116, 138 ] }, { "url": "http://t.co/KXtW6Vc8mQ", "expanded_url": "http://twitter.com/The_YUNiversity/status/546092692229201920/photo/1", "display_url": "pic.twitter.com/KXtW6Vc8mQ", "indices": [ 139, 140 ] } ] }, "favorited": false, "retweeted": false, "possibly_sensitive": false, "lang": "en" } ], "search_metadata": { "completed_in": 0.022, "max_id": 546097597551628300, "max_id_str": "546097597551628289", "next_results": "?max_id=546097597052891137&q=love&lang=en&count=10&include_entities=1", "query": "love", "refresh_url": "?since_id=546097597551628289&q=love&lang=en&include_entities=1", "count": 10, "since_id": 0, "since_id_str": "0" } } The code returns as valid JSON, so from all my digging I believe it is a problem with Unity converting the text format in an invalid way. The closest answer I could find is this older thread: http://forum.unity3d.com/threads/problem-converting-text-with-unescape-to-text-with-accents.108469/ Will I need to loop through my results to eliminate improper characters? Is the problem the parsing of unusual characters like emoticons, or am I totally missing something here?