I have checked that Ο valid for a JavaScript variable name. Also, when I try to write var Ο = Math.PI in the Chrome console, everything is fine.
However, when I include the var Ο = Math.PI inside a .js file written using Sublime Text 2 on a Mac, Chrome complains:
Uncaught SyntaxError: Unexpected token ILLEGAL
I tried the encodings UTF-8, UTF-16 LE and UTF-16 BE, but no one works. When I execute the console.log('Ο') written inside Sublime Text 2 with UTF-8, Chrome prints:
Γβ¬
How can I use the JavaScript Ο variable name in Sublime Text 2 so that Chrome understands this?
Randomblue
source share