hey everyone, could be a very noob question,
im on mac writing in c# , i need a degrees sign in my string, for example, 70˚,
but when i have it in a string, its changing it to a ? mark,
any thoughts?
TempText.guiText.text = ""+Temp+"°";
hey everyone, could be a very noob question,
im on mac writing in c# , i need a degrees sign in my string, for example, 70˚,
but when i have it in a string, its changing it to a ? mark,
any thoughts?
TempText.guiText.text = ""+Temp+"°";
the stuff there is correct, chances are that you just don’t use a font that has the sign in at all
im using the default arial within unity
Save the script as UTF-8.
–Eric
add an own one and check again
The default arial font works with ° no problem. You just need to save your script using Unicode not ASCII.
–Eric
The unity editors, no matter which one, only store in Unicode and new script files created in unity are unicode too. They don’t even support ANSI - ASCII file creation.
That aside, ° is a regular ANSI character, not even an ASCII one, so even if it were not stored in unicode it still should work fine.
thats why I assumed it was related to the font as its incomplete in general or at least used to be for a long time lacking anything but ANSI
Nope, Unitron uses ASCII (by default I think). You can change it in the preferences to always use UTF-8.
Nope again, if you use ASCII text encoding for your script, it won’t display °.
–Eric
I am going to absolutely, totally disagree… The standard editor that comes with Unity stores it’s files as ASCII
from Wikipedia
Clearly, you can see this normal js file that I created in Unity holds the ASCII format. So you would have to specify that you wanted to save your code in Unicode.