JavaScript strings - UTF-16 vs UCS-2?

前端 未结 3 1841
一向
一向 2020-12-01 05:53

I\'ve read in some places that JavaScript strings are UTF-16, and in other places they\'re UCS-2. I did some searching around to try to figure out the difference and found t

3条回答
  •  盖世英雄少女心
    2020-12-01 06:00

    Its just a 16-bit value with no encoding specified in the ECMAScript standard.

    See section 7.8.4 String Literals in this document: http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-262.pdf

提交回复
热议问题