S
Scott Matthews
I've recently come upon an odd Javascript (and/or browser) behavior,
and after hunting around the Web I still can't seem to find an answer.
Specifically, I have noticed that the Javascript encode() function
behaves differently if a codepage has been set.
For example:
<script>
document.write(escape('Ôèëìè'));
(note: that should be five accented characters)
</script>
Produces: %D4%E8%EB%EC%E8
But setting the codepage to Windows-1251:
<META HTTP-EQUIV="Content-Type" CONTENT="text/html;
charset=Windows-1251">
<script>
document.write(escape('Ôèëìè'));
</script>
Produces: %u0424%u0438%u043B%u043C%u0438
Personally, I wouldn't expect the Javascript encode() function to
change its behavior if the codepage has been changed.
Might you know of any resources that can help me better understand
what's happening there?
Many thanks!
Scott
and after hunting around the Web I still can't seem to find an answer.
Specifically, I have noticed that the Javascript encode() function
behaves differently if a codepage has been set.
For example:
<script>
document.write(escape('Ôèëìè'));
(note: that should be five accented characters)
</script>
Produces: %D4%E8%EB%EC%E8
But setting the codepage to Windows-1251:
<META HTTP-EQUIV="Content-Type" CONTENT="text/html;
charset=Windows-1251">
<script>
document.write(escape('Ôèëìè'));
</script>
Produces: %u0424%u0438%u043B%u043C%u0438
Personally, I wouldn't expect the Javascript encode() function to
change its behavior if the codepage has been changed.
Might you know of any resources that can help me better understand
what's happening there?
Many thanks!
Scott