Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: ken on August 02, 2013, 12:29:57 PM

Title: error in UIFont when it's utf-16 character
Post by: ken on August 02, 2013, 12:29:57 PM
Hi,

I got ArgumentException: invalid utf-16 sequence at -1073752784 (missing surrogate tail) when utf-16 characters are used.

ArgumentException: invalid utf-16 sequence at -1073752784 (missing surrogate tail)
Parameter name: string
UIFont.CalculatePrintedSize (System.String text, Boolean encoding, SymbolStyle symbolStyle) (at Assets/NGUI/Scripts/UI/UIFont.cs:642)
UILabel.ProcessText () (at Assets/NGUI/Scripts/UI/UILabel.cs:507)
UILabel.get_relativeSize () (at Assets/NGUI/Scripts/UI/UILabel.cs:428)
UILabel.MakePositionPerfect () (at Assets/NGUI/Scripts/UI/UILabel.cs:545)
UILabel.OnFill (.BetterList`1 verts, .BetterList`1 uvs, .BetterList`1 cols) (at Assets/NGUI/Scripts/UI/UILabel.cs:636)
UIWidget.UpdateGeometry (.UIPanel p, UnityEngine.Matrix4x4& worldToPanel, Boolean parentMoved, Boolean generateNormals) (at Assets/NGUI/Scripts/Internal/UIWidget.cs:517)
UIPanel.UpdateWidgets () (at Assets/NGUI/Scripts/UI/UIPanel.cs:857)
UIPanel.LateUpdate () (at Assets/NGUI/Scripts/UI/UIPanel.cs:1013)

Does that mean utf-16 is not supported by NGUI? or is it a Unity Font issue?

Thanks
Title: Re: error in UIFont when it's utf-16 character
Post by: ArenMook on August 02, 2013, 08:17:35 PM
Use UTF8, not UTF16. UTF16 is not supported by Unity as far as I know.
Title: Re: error in UIFont when it's utf-16 character
Post by: ken on August 04, 2013, 11:24:25 AM
but it looks Unity claims they have full unicode support.

http://docs.unity3d.com/Documentation/Components/class-Font.html