Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

problem with UTF-32 characters, like: 🍀 or 💕 #19

Open
fpv999 opened this issue Feb 24, 2019 · 1 comment
Open

problem with UTF-32 characters, like: 🍀 or 💕 #19

fpv999 opened this issue Feb 24, 2019 · 1 comment

Comments

@fpv999
Copy link

fpv999 commented Feb 24, 2019

those UTF-32 characters ( like U+1F340) are stored in 4-bytes sequences, starting with 0xD8xx ... thus in one moment Unity Text components receives only a first-half of the UTF-32 character, which leads to crash like this:

ArgumentException: invalid utf-16 sequence at -1819518832 (missing surrogate tail) Parameter name: string

UnityEngine.TextGenerator.Populate_Internal (System.String str, UnityEngine.Font font, Color color, Int32 fontSize, Single scaleFactor, Single lineSpacing, FontStyle style, Boolean richText, Boolean resizeTextForBestFit, Int32 resizeTextMinSize, Int32 resizeTextMaxSize, Int32 verticalOverFlow, Int32 horizontalOverflow, Boolean updateBounds, TextAnchor anchor, Single extentsX, Single extentsY, Single pivotX, Single pivotY, Boolean generateOutOfBounds, Boolean alignByGeometry, System.UInt32& error)
UnityEngine.TextGenerator.Populate_Internal (System.String str, UnityEngine.Font font, Color color, Int32 fontSize, Single scaleFactor, Single lineSpacing, FontStyle style, Boolean richText, Boolean resizeTextForBestFit, Int32 resizeTextMinSize, Int32 resizeTextMaxSize, VerticalWrapMode verticalOverFlow, HorizontalWrapMode horizontalOverflow, Boolean updateBounds, TextAnchor anchor, Vector2 extents, Vector2 pivot, Boolean generateOutOfBounds, Boolean alignByGeometry, UnityEngine.TextGenerationError& error)
UnityEngine.TextGenerator.PopulateAlways (System.String str, TextGenerationSettings settings)
UnityEngine.TextGenerator.PopulateWithError (System.String str, TextGenerationSettings settings)
UnityEngine.TextGenerator.Populate (System.String str, TextGenerationSettings settings)
UnityEngine.TextGenerator.GetPreferredWidth (System.String str, TextGenerationSettings settings)
UnityEngine.UI.Text.get_preferredWidth ()
UnityEngine.UI.LayoutUtility.m__2 (ILayoutElement e)
UnityEngine.UI.LayoutUtility.GetLayoutProperty (UnityEngine.RectTransform rect, System.Func2 property, Single defaultValue, ILayoutElement& source) UnityEngine.UI.LayoutUtility.GetLayoutProperty (UnityEngine.RectTransform rect, System.Func2 property, Single defaultValue)
UnityEngine.UI.LayoutUtility.GetPreferredWidth (UnityEngine.RectTransform rect)
UnityEngine.UI.LayoutUtility.GetPreferredSize (UnityEngine.RectTransform rect, Int32 axis)
UnityEngine.UI.HorizontalOrVerticalLayoutGroup.GetChildSizes (UnityEngine.RectTransform child, Int32 axis, Boolean controlSize, Boolean childForceExpand, System.Single& min, System.Single& preferred, System.Single& flexible)
UnityEngine.UI.HorizontalOrVerticalLayoutGroup.CalcAlongAxis (Int32 axis, Boolean isVertical)
UnityEngine.UI.VerticalLayoutGroup.CalculateLayoutInputHorizontal ()
UnityEngine.UI.LayoutRebuilder.m__2 (UnityEngine.Component e)
UnityEngine.UI.LayoutRebuilder.PerformLayoutCalculation (UnityEngine.RectTransform rect, UnityEngine.Events.UnityAction`1 action)
UnityEngine.UI.LayoutRebuilder.Rebuild (CanvasUpdate executing)
UnityEngine.UI.CanvasUpdateRegistry.PerformUpdate ()
UnityEngine.Canvas:SendWillRenderCanvases()

@edwardrowe
Copy link

edwardrowe commented Feb 25, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants