Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Bug Getting text from TextMeshProUGUI.text creates additional escape character

Discussion in 'UGUI & TextMesh Pro' started by Stewcooker, May 1, 2023.

  1. Stewcooker


    Mar 11, 2018
    So I am using the editor editor to fill in a few TMP text boxes, and the text I am using makes frequent use of the emdash character, U+2014. In the editor text box, I am inserting "\u2014" to add the emdash to my text.

    However, later I am getting text from these text boxes via TextMeshProUGUI.text. When this happens, my "\u2014" gets escaped, and my string now looks like "\\u2014", causing displaying this string elsewhere to show "\u2014" instead of an emdash.

    Is this problem caused by entering the text in the unity editor, or is there something I am doing incorrectly? How can I avoid this issue without writing a parser or something like that?