[Javascript] Re: Charset (sort-of OFF_TOPIC for js)

tedd tedd at sperling.com
Mon Aug 14 08:39:16 CDT 2006


At 9:53 AM +1000 8/14/06, Roland Neilands wrote:
>>Up to now, I never made the connection that if I place a charset at 
>>UFT-8 in a web page document that I should also save the document 
>>as a UTF-8 file. I'm sure that I am not alone in this error. I'm 
>>also not sure as to how to save a document as UTF-8 encoding in the 
>>first place.
>>
>Even notepad has an encoding selection in the save as box. You 
>should also consider your target fonts if changing it.
>It's worth noting here that XML (and so xhtml too - not sure how the 
>meta stuff or IE's prolog bug interacts) DEFAULTS to utf-8 unless 
>you specify otherwise in the prolog eg. <?xml version="1.0" 
>encoding="ISO-8859-1"?>
>This is a pain if you've accepted whatever editors save as default 
>encoding & it's not utf-8 - some apps will choke, others may work 
>fine.
>
>Cheers,
>Roland

Roland:

My IDE does not give a clear (at least to me) indication of what 
encoding is being used to save documents. I now may be faced with 
re-saving thousands of documents -- arrggg.

I've never understood the need for the saved document charset to 
match encoding. I always thought that the charset meta tag signaled 
what charset (in the strict Unicode sense) you were using in your 
document. In other words, if you were using a charset that was other 
than Latin, you must set your charset to UTF-8 and then use whatever 
code-points you wanted. Now, I understand better.

However, the whole situation seems a bit redundant, doesn't it? You 
have to both save your document in the right charset encoding AND 
then again restate the charset encoding in the document. Why twice? 
Is it that some browsers can detect the encoding and others can't?

Lastly, to bring this back on topic, can wrong encoding adversely affect js?

tedd
-- 
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com



More information about the Javascript mailing list