Jump to content
iwato

UNICODE Strings in HTML and Javascript

Recommended Posts

QUESTION:  Is the following an accurate statement?  If not, please clarify how a unicode string literal differs from say, an ASCII string literal.

Quote

A UNICODE character string is an array-object of single character elements each with its own directional indicator.

Roddy

Untitled-1.html

Edited by iwato

Share this post


Link to post
Share on other sites

In Javascript, all strings are internally treated as UTF-16 strings:

http://ecma-international.org/ecma-262/5.1/#sec-8.4

http://speakingjs.com/es5/ch24.html

When a String contains actual textual data, each element is considered to be a single UTF-16 code unit. Whether or not this is the actual storage format of a String, the characters within a String are numbered by their initial code unit element position as though they were represented using UTF-16. All operations on Strings (except as otherwise stated) treat them as sequences of undifferentiated 16-bit unsigned integers; they do not ensure the resulting String is in normalised form, nor do they ensure language-sensitive results.

  • Thanks 1

Share this post


Link to post
Share on other sites

I'm not familiar with that, I feel like I used something similar to that at one point but that project is only 2 years old so it wouldn't have been that.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...