OK, I finally figured out why some people have insisted that only UTF-16 encoding works for scripts when using characters outside the ASCII range, when UTF-8 has worked fine for me. Namely:
function Start () {
var testString = "©®";
Debug.Log ("Test1: " + testString);
}
vs.
using UnityEngine;
public class Test : MonoBehaviour {
void Start () {
var testString = "©®";
Debug.Log ("Test2: " + testString);
}
}
The Unityscript code prints “©®” regardless of UTF-8 or UTF-16 encoding. The C# code only prints “©®” when using UTF-16, otherwise it prints “???” if using UTF-8. So…yeah. Not sure why, but I’ll keep that in mind from now on.
–Eric