T
Thomas 'PointedEars' Lahn
Dr said:[...] VK said:Also I guess (only guess) that indirectly it answers on another
occasional question: "What is the longest string value allowed in
JavaScript?" Skipping on mechanical limits (memory), by language itself
I would say that it's 9007199254740992 characters or lesser to be able
to use any of string methods (otherwise rounding error for length will
kill them).
Characters are Unicode, so one should probably think of a number and
halve it, allowing 2 bytes per character. ECMA says they are 16 bits.
They are 16 bits _at least_. ECMAScript Edition 3 (not ECMA, ECMAScript is
also an ISO/IEC Standard) says that string values are encoded using UTF-16.
It is true that one UTF-16 code unit is 16 bits (hence the name), but one
Unicode character can be required to be encoded with more than one UTF-16
code unit.
PointedEars