Lőrinczy Zsigmond wrote:
I open a window from JavaScript with w=window.open,
write content with w.document.open,w.document.write,
w.document.close. I specified charset with
<meta http-equiv="Content-Type"
content="text/html; charset=ISO-8859-2">
but did not help much.
In Internet Explorer w.document.charset="ISO-8559-2"
after w.document.open solved the problem, but with Mozilla
this do not work. There is a w.document.characterSet, but
this is read only. Mozilla seems forcing UTF-8 - is there a way
to change this?
I am not sure I understand the problem, once you are having script
writing to the page you are using JavaScript strings and these allow you
to use all Unicode characters directly or encoded
(String.fromCharCode(unicode), '\udddd')) so character set problems
shouldn't arise.
For instance the following writes the Euro symbol and a German umlaut to
the window just fine with Netscape 7.2:
var text = 'Der Preis ist 200€ über dem Limit.';
var win = window.open('', 'jsWin',
'width=300,height=300,scrollbars,resizable');
win.document.open();
win.document.write('<p>' + text + '<\/p>');
win.document.close();
In what way do you think Mozilla is "forcing UTF-8", how do figure that?
--
Martin Honnen
http://JavaScript.FAQTs.com/