JS: Source Code Encoding
What is JavaScript's Charset?
JavaScript source code's charset is Unicode.
What is JavaScript's default encoding for source code?
- JavaScript spec does not specify a default encoding for source code file.
- It depends on the encoding from HTTP protocol configured by the web server. 〔see HTTP Protocol Tutorial〕
UTF-8 encoding is recommended. You should save JavaScript file in UTF-8 encoding. UTF-8 is the standard encoding for much of web technologies.
Reference
