Google
 
Webnews.only-4-geeks.com
Interesting places
news.only-4-geeks.com Forum Index » JavaScript

ECMAScript character set is UTF-16?

 
Jump to:  
 
optimistx
PostPosted: Thu Sep 04, 2008 4:33 pm    Post subject: ECMAScript character set is UTF-16?
       
Is it true that in order to follow standard, javascript code must be UTF-16?
ECMA-262.pdf, chapter 6:

"ECMAScript 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."

If so, should I send js-files from the server in that format instead of
UTF-8, to be a standards obeying citizen?
 

 
Joost Diepenmaat
PostPosted: Thu Sep 04, 2008 4:42 pm    Post subject: Re: ECMAScript character set is UTF-16?
       
"optimistx" <optimistxPoista@poistahotmail.com> writes:

Quote:
Is it true that in order to follow standard, javascript code must be UTF-16?
ECMA-262.pdf, chapter 6:

"ECMAScript 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."

If so, should I send js-files from the server in that format instead of
UTF-8, to be a standards obeying citizen?

Assuming you're talking about browser scripting, no you don't have
to. Since javascript has no built-in methods of reading files or
streams, all source text must be provided by the host (the browser, or
whatever) in whatever encoding(s) the particular implementation
accepts (which may or may not be UTF-16, but there isn't really any
way to tell from JS code in an otherwise conformant implementation).

Since all decent browsers can deal with a multitude of text encodings,
it's not needed to sent JS in UTF-16. You can also use ASCII, UTF8,
Latin-1 and probably a bunch of other encodings - the browser should
translate it if needed.

--
Joost Diepenmaat | blog: LINK | work: LINK
 

Page 1 of 1 .:.

Google
 
Webnews.only-4-geeks.com

Windows Update | C++ | C | PHP | JavaScript | Photoshop | Programming | Windows 2000 | Python | Windows XP | Object | Flash | Flash - ActionScript | Paint Shop Pro | Excel | PowerPoint | Access | Word | Windows 98 | Internet Explorer 6.0 | CorelDraw12 | Java | XML | asm x86 | Linux Mandrake | Linux RedHat | Outlook |  | news from newsgroups |_ | s

Web Templates

Awesome Website Templates ©

Diety walczak deska podłogowa Our Hotel sklep tuningowy Makumba - Big Cyc