Search Unity

Unicode via text property

Discussion in 'UGUI & TextMesh Pro' started by Telhurin, Aug 30, 2021.

  1. Telhurin

    Telhurin

    Joined:
    Feb 8, 2015
    Posts:
    18
    Hello! First of all obligatory thank you for all the amazing work done with TMP, it's insane how robust and extended it became over the years of your hard work <3.

    I have a small issue with Unicode inserted directly in the text. Pasting: "\u00b0 some text" to a text input works just fine, but setting this same value with code will output raw text until the text is marked as dirty again (ex. by typing anything again in the text input). Is there some char/sequence/setting/call I'm missing here?

    Simple example code:

    Code (CSharp):
    1. using TMPro;
    2. using UnityEngine;
    3.  
    4. public class TmpTest : MonoBehaviour
    5. {
    6.     public TMP_Text tmp_text;
    7.     public string toPaste;
    8.  
    9.     private void Start()
    10.     {
    11.         tmp_text.text = toPaste;
    12.     }
    13. }
    Unity Version: 2020.3.10f1
    Platform: Windows Editor:
    TMP version: 3.0.6
     
  2. Telhurin

    Telhurin

    Joined:
    Feb 8, 2015
    Posts:
    18
    I've just noticed that my texts from google sheet are automatically escaped while parsed and so is the default unity text input window. Sorry for bother :D.