how can I simulate clicking View=>Encoding=>Western European (ISO) in a jscript? RRS feed

  • Question

  • I need to do some special translation of characters for a page that is generated for me by a product's CGI script.  The original data is stored in EBCDIC on a mainframe system.  Although I set the encoding to ISO-8859-1 in a meta tag in a skeleton page that the CGI program uses, the encoding for the page is always set to UTF-8 and then the layout is wrong and I can't convert the character codes in the page with charCodeAt.  The part of the body tag that's generated with the CGI script is a <pre> tag to maintain the original layout.  When I click View=>Encoding=>Western European (ISO) after the page has loaded my character conversion script then works as the page seems to be reloaded from cache with the correct enocding, i.e. ISO-8859-1 but I've found no way of simulating this action.  I've tried location.reload(false) and history.go(0) after resetting the encoding with document.charset but the CGI script always gets re-submitted to the server and then everthing starts again.  Can anyone help?

    Saturday, August 1, 2009 8:09 AM