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. Voting for the Unity Awards are OPEN! We’re looking to celebrate creators across games, industry, film, and many more categories. Cast your vote now for all categories
    Dismiss Notice
  3. Dismiss Notice

Problem displaying numbers in UI.text

Discussion in 'UGUI & TextMesh Pro' started by Albertuko, Nov 13, 2018.

  1. Albertuko

    Albertuko

    Joined:
    Oct 17, 2017
    Posts:
    2
    Hi,

    I'm trying to display a text which contains numbers in a UI.Text, For example:
    Code (csharp):
    1. string msg = "15 x 30 cm";
    msg is previously read from an XML file with UTF-8 encoding.
    With Debug.Log(msg) the output on console is correct, but assigning the text to a UI.text text component results in strange characters.


    Any ideas on what's happening?
     
  2. MSplitz-PsychoK

    MSplitz-PsychoK

    Joined:
    May 16, 2015
    Posts:
    1,278
    Maybe your font doesn't include numbers? Try a different font.

    If that's not it, does the same thing happen when you manually enter numbers into the text field, or is it only when you read the string from an XML file?
     
  3. Albertuko

    Albertuko

    Joined:
    Oct 17, 2017
    Posts:
    2
    It was the font. Thank you very much.