JS: Default Charset/Encoding
ECMAScript code is expressed using Unicode, version 8.0.0 or later. ECMAScript source text is a sequence of code points. All Unicode code point values from U+0000 to U+10FFFF, including surrogate code points, may occur in source text where permitted by the ECMAScript grammars. The actual encodings used to store and interchange ECMAScript source text is not relevant to this specification.
- If the file is embedded in HTML page, then it depends on the encoding used for that page (and other factors such as HTTP header.).
[see HTTP Protocol Tutorial]
… The actual encodings used to store and interchange ECMAScript source text is not relevant to this specification.
Regardless of the external source text encoding, a conforming ECMAScript implementation processes the source text as if it was an equivalent sequence of SourceCharacter values, each SourceCharacter being a Unicode code point. Conforming ECMAScript implementations are not required to perform any normalization of source text, or behave as though they were performing normalization of source text.
// -*- coding: utf-8 -*-
This line indicates what encoding is used for a file, and is standard for Python, Ruby, emacs lisp, and many editors.
[see Ruby: Unicode Tutorial 💎]
[see Emacs: Unicode Tutorial]
- JS: Default Charset/Encoding
- JS: String Code Unit vs Code Point
- JS: Unicode Character Escape Sequence
- JS: Allowed Characters in Identifier
- HTML: Allowed Characters in id Attribute
- HTML: Character Sets and Encoding
- HTML/XML Entity List
- JS: Template String
- JS: Convert String to Number
- JS: Encode URL, Escape String
- JS: Format Number
- JS: JSON Object
Ask me question on patreon