SlideShare a Scribd company logo
Encoding in javascript
Encoding in JavaScriptfahai [at] TaobaoUED
ECMA 262 - §6ECMAScript source text is represented as a sequence of characters in the Unicode character encoding, version 2.1 or later, using the UTF-16 transformation format. The text is expected to have been normalised to Unicode Normalised Form C (canonical composition), as described in Unicode Technical Report #15.Conforming ECMAScript implementations are not required to perform any normalisation of text, or behave as though they were performing normalisation of text, themselves.
SourceCharacter :: any Unicode character
Rhino Book - §3.2JavaScript programs are written using the Unicode character set.Although the ECMAScript v3 standard allows Unicode characters anywhere in a JavaScript program, versions 1 and 2 of the standard allow Unicode characters only in comments and quoted string literals; all elements are restricted to the ASCII character set. Versions of JavaScript that predate ECMAScript standardization typically do not support Unicode at all.
Code-point, not byte
Examplevar草泥马 = function() {this.constructor.prototype.咆哮 = function(叫声) {        alert(叫声);    };};new 草泥马().咆哮("除尽天下河蟹日,家祭无忘告乃翁!");
Examplealert(String.fromCharCode(35201, 21644, 35856, 65292, 35201, 26377, 29233));
related functionsescape()encodeURI()encodeURIComponent()
ReferenceECMAScript Specification - 3rd EditionJavaScript - The Definition Guide - 5th Edition
Thanks

More Related Content

PDF
Drink like Bond (English)
PPTX
Es51
PDF
JavaScript - Like a Box of Chocolates - jsDay
PDF
ECMASCRIPT.NEXT
PDF
Spirit-teknologiapäivät Petri Niemi HTML5 & JavaScript Developereille
PDF
Building cross platform applications using Windows Azure Mobile Services
PDF
Testing apps with MTM and Tea Foundation Service
PPTX
Gengo Africa
Drink like Bond (English)
Es51
JavaScript - Like a Box of Chocolates - jsDay
ECMASCRIPT.NEXT
Spirit-teknologiapäivät Petri Niemi HTML5 & JavaScript Developereille
Building cross platform applications using Windows Azure Mobile Services
Testing apps with MTM and Tea Foundation Service
Gengo Africa

Viewers also liked (17)

PPTX
Rendering in browser
PDF
Nips yomikai 1226
DOCX
Case study
PDF
LeSS in action
PDF
Acl yomikai, 1016, 20110903
PPTX
Mars attack 2010-07-16
PDF
Pagelet in action
PPTX
Mars attack 2011-04-15
PDF
Dpl in action
PPTX
Mobilize your Retail Customer Experience with iBeacons and Proximity Marketing
PDF
VISUG: Visual studio for web developers
PPT
Employee Perception Towards Organization Change
PPTX
Charset and encoding
PDF
JavaScript Core
PPS
Innovative Changes In Human Resource Management
PDF
Icml yomikai 07_16
PPTX
Gitlab - the new workbench (2nd edition)
Rendering in browser
Nips yomikai 1226
Case study
LeSS in action
Acl yomikai, 1016, 20110903
Mars attack 2010-07-16
Pagelet in action
Mars attack 2011-04-15
Dpl in action
Mobilize your Retail Customer Experience with iBeacons and Proximity Marketing
VISUG: Visual studio for web developers
Employee Perception Towards Organization Change
Charset and encoding
JavaScript Core
Innovative Changes In Human Resource Management
Icml yomikai 07_16
Gitlab - the new workbench (2nd edition)
Ad

Similar to Encoding in javascript (16)

PPT
basic c++(1)
PPT
c++ Lecture 1
PPT
Lecture 1
PDF
compiler.pdfljdvgepitju4io3elkhldhyreyio4uw
PDF
Wasm intro
PDF
PDF
Structure-Compiler-phases information about basics of compiler. Pdfpdf
PPTX
C Language Compiler in Python c language compiler using python
PPTX
CD U1-5.pptx
PPT
7068458.ppt
PPT
object oriented programming in java lecture
PDF
The scanner performs lexical analysis of a precise program (in our c.pdf
DOCX
2-Design Issues, Patterns, Lexemes, Tokens-28-04-2023.docx
PPTX
Yacc (yet another compiler compiler)
PPTX
Compiler design
basic c++(1)
c++ Lecture 1
Lecture 1
compiler.pdfljdvgepitju4io3elkhldhyreyio4uw
Wasm intro
Structure-Compiler-phases information about basics of compiler. Pdfpdf
C Language Compiler in Python c language compiler using python
CD U1-5.pptx
7068458.ppt
object oriented programming in java lecture
The scanner performs lexical analysis of a precise program (in our c.pdf
2-Design Issues, Patterns, Lexemes, Tokens-28-04-2023.docx
Yacc (yet another compiler compiler)
Compiler design
Ad

Encoding in javascript

  • 3. ECMA 262 - §6ECMAScript source text is represented as a sequence of characters in the Unicode character encoding, version 2.1 or later, using the UTF-16 transformation format. The text is expected to have been normalised to Unicode Normalised Form C (canonical composition), as described in Unicode Technical Report #15.Conforming ECMAScript implementations are not required to perform any normalisation of text, or behave as though they were performing normalisation of text, themselves.
  • 4. SourceCharacter :: any Unicode character
  • 5. Rhino Book - §3.2JavaScript programs are written using the Unicode character set.Although the ECMAScript v3 standard allows Unicode characters anywhere in a JavaScript program, versions 1 and 2 of the standard allow Unicode characters only in comments and quoted string literals; all elements are restricted to the ASCII character set. Versions of JavaScript that predate ECMAScript standardization typically do not support Unicode at all.
  • 7. Examplevar草泥马 = function() {this.constructor.prototype.咆哮 = function(叫声) { alert(叫声); };};new 草泥马().咆哮("除尽天下河蟹日,家祭无忘告乃翁!");
  • 10. ReferenceECMAScript Specification - 3rd EditionJavaScript - The Definition Guide - 5th Edition