lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Tue, Oct 26, 2010 at 8:43 PM, Jonathan Castello <twisolar@gmail.com> wrote:
> I was under the impression that UTF-8, which Javascript strings use,
> puts restrictions on certain bytes. From Wikipedia's page for UTF-8,
> bytes above 127 are either part of a sequence, or are reserved.

Javascript code only "sees" strings as a sequence of Unicode
characters, the internal representation of those characters in memory
(UTF-8 or otherwise) is hidden and inaccessible. U+0000 through to
U+00FF are all valid Unicode characters, so it's certainly possible to
use a Javascript string to store a sequence of arbitrary octets, but
they will be taking up more space in memory than just that number of
bytes.

-Duncan