iOS text issue

Hi, I am getting an issue where certain characters are replaced with a box character (unicode \u25A1) in my App. The issue exists with UI Text and TextMeshPro text. It displays correct when typed into the Text input field (in the editor and on the app build) however when called from a script certain characters are replaced with the box character. It only does this on a Mac and the iOS build, on PC and Android build they work correctly.
Has anyone come across the same issue or any ideas on what is going on.

It seems like the issue you’re facing is related to character encoding or font support on different platforms. The box character (□, Unicode U+25A1) usually appears when a font does not support a particular character, or the character encoding is not handled correctly.

To resolve this issue, try this:

  1. Make sure you’re using a font that supports the characters you want to display. You can check the font’s character support using a font editor or an online tool.

  2. If you’re using TextMeshPro, ensure that the Font Asset contains the characters you need. You can create a new Font Asset or modify the existing one:

  • Select your TextMeshPro component.

  • In the Inspector, click on the Font Asset (usually located under the TextMeshPro component).

  • In the Font Asset’s Inspector, click on the small cogwheel icon in the top right corner, and choose “Edit…”.

  • In the Font Asset Creator window, you can add the missing characters to the “Character Set” field or choose “Unicode Range” and specify the range that includes the characters you need.

  • Click “Generate Font Atlas” and then “Save”.

  1. Ensure that your text files or scripts use the correct character encoding (preferably UTF-8). If you’re reading text from a file, make sure the file is saved with the appropriate encoding.

  2. If you’re using UI Text, consider switching to TextMeshPro as it provides better cross-platform support and more features.

Let me know if that helps.

Hi Steen, thanks for your answer. The Unicodes I included on both .TTF font and the TextMeshPro Build. They worked when I type in the text field, it was just a problem when I tried to fill the field from a script using the “”.
For example in the script:
public TextMeshProUGUI finishResponce;
If I tried finishResponce.text = "Popeth yn gywir ar ôl ";
The character ô would be replaced with the □

The issue must be an iOS thing. To solve the issue I created a string Array called stringResponce and copied the text string I had in the code into the array in the editor then just called the string needed from that array as follows.
finishResponce.text = stringResponce[0];
That worked correctly without doing anything to the font or the TextMeshPro objects.
Very weird but it’s working now, thanks again.