Are the numbers in this object UTF-8 compatible/permissible?
I’m not quite sure, but I hear that UTF-8 is a standard and I wanted to be sure that if I use this object throughout my Javascript that it will work in UTF-8 compatible contexts.
var specialOnes = {
0 : "cero",
1 : "uno",
2 : "d\xF3s", // "dos" with accent
3 : "tr\xE9s", // "tres" with accent
4 : "cuatro",
5 : "cinco",
6 : "s\xE9is", // "seis" with accent
7 : "siete",
8 : "ocho",
9 : "nueve",
};
By compatible you would be asking whether the strings would be interpreted as the same across all environments?
If so, then yes they are correctly encoded, all implementations of modern browsers, javascript interrupters, etc are capable of reading various utf encodings.
The only errors that could arise would be from you incorrectly typing said string or you not specifying that the charset be utf-8.