TextAsset broken halfway

When loading the a TextAsset I have it is always cut off at 2595 Characters even though my Debug.log of it’s length shows it at 35356. Is there a way to bypass TextAsset’s limit?


Hmm, I tried using different files, txt, htmls different documents, they are all cut off at 2595 characters. This is unity 3.4 IOS versions. I have tried it on on two different computers as well. it’s still the same thing. When I open them using text wrangler or text edit its ok but when I Debug.Log it in Unity3d it cuts off.

//EDIT 2

Sorry if I wasn’t clear, I Debug.Logged the TextAssets.text.Length not the string. Also the cutoff happens when I used it as a GUI.Label or GUI.TextArea as well. Text Wrangler and text edit display all of them just fine.

TextAsset doesn’t have any limit, and isn’t cut off at 2595 characters. Maybe your file is corrupt.

Sorry to post an answer when is only a confirm, strings are truncated when put in a GUI element, no matter if a box or a label.
String.Length is always correct, but the GUI label will truncate the string somewhere. I guess this might be a bug in thet old GUI system, which is there since unity 1.0(2007)

By the way, we are not using text asset for this, but stored PlayerPrefs.SetString
When retrieved into a string variable, myString.Length report the correct number of characters(eg:24830) but the GUI.Label which is much taller than the space required, calculated with GUIStyle.calcSize or GUILAyout.GetRect, still show a truncated(around 16000 bytes here) string!
Oh, of course the GUI.Label is within a scrollview, which is internally sized like the GUI.label.

It turns out the limit for a GUi element is 16382 bytes. Read on the forums