Quantcast
Viewing all articles
Browse latest Browse all 1908

Internet Explorer prints barbage when printing a non-English HTML file on Windows 7 Pro

Hi

I'm trying to print HTML files, which have a header defining their charset, most of them don't use English. Some are Japanese and use UTF8, some are Russian and use "windows-1251" etc...

Example:
<html>
<header>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
</header>
<body>
*JAPANESE TEXT*
</body>

I use this code to call IE9 in the background and print: (VB6 Dot.Net4)

Private Sub InitBrowser()
            Dim log As New [Shared].Logging.Logger()
            log.Write("Initializing IE DLL - c:\windows\system32\shdocvw.dll", LogName)
            Do
                Try
                    mobjExplorer = New SHDocVw.InternetExplorer()
                    Exit Do
                Catch ex As Exception
                    log.Write("Error initializing IE", LogName)
                   Threading.Thread.Sleep(100)
                End Try
            Loop
            mobjExplorer.Visible = False
            mobjExplorer.Silent = True
        End Sub

And the command itself for printing:

mobjExplorer.ExecWB(SHDocVw.OLECMDID.OLECMDID_PRINT, SHDocVw.OLECMDEXECOPT.OLECMDEXECOPT_DONTPROMPTUSER)

My System Locale is English United States, as well as my Formats and Location (I refer to the tabs on intl.cpl).

My problem is that every HTML that isn't written in English comes out in Gibberish.

I use Windows 7 Pro with IE9.

When I used the same code on Windows XP with IE6 all HTMLs were printed OK.

I'm lost - tried to investigate everything and couldn't find a way to make it work.

Please advise.

Edit:
I can't manually change the system Locale to match the file (Which of course solves it, but requires a reboot) - this workstation should work independently - get files and print them without human intervention. 


Viewing all articles
Browse latest Browse all 1908

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>