Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Strange Unicode problem

Discussion in 'UGUI & TextMesh Pro' started by zforest, Jun 16, 2021.

  1. zforest

    zforest

    Joined:
    Feb 24, 2019
    Posts:
    6
    At runtime I set a string with accented letters represented by unicode digits

    Soci\u00e9t\u00e9 G\u00e9n\u00e9rale

    to MyTextMeshPro.text

    The rendered result doesn't show accented letters, but the Unicode digits:
    'Soci\u00e9t\u00e9 G\u00e9n\u00e9rale'

    But if I select in editor the TextMeshPro component, and modify the string in anyways such as adding a character, then the rendered result correctly shows the accented letters.

    I'm assuming this triggers a rebuild and thus corrects the problem? But I manually call
    MyTextMeshPro.Rebuild()
    MyTextMeshPro.SetDirty()

    but none works
     
  2. zforest

    zforest

    Joined:
    Feb 24, 2019
    Posts:
    6

    This is the text after it was set at runtime to this TextMeshPro text via
    assignment to MyTextMeshPro.text. Notice on the left side's scene view, the unicode shows up.



    As soon as I manually add a space character to the text in the editor, then the accented character shows up in the scene view.

    Adding/changing text in any other way in the Unity editor also corrects the accented character.
    But if done programatically, it doesn't do any correction