[wxPython-users] Failed to display HTML document in ISO-8859-1 encoding

Milos Negovanovic milos.negovanovic at googlemail.com
Mon Sep 4 08:25:31 PDT 2006


On Mon, Sep 04, 2006 at 01:36:09PM +0800, Anthony Wiese wrote:
> It looks like you're trying to send non ISO-8859-1 characters to your HTML
> control, which is trying to convert it. Either you can strip out any
> offending characters, or else you probably need to change your html header.
> 
> If you make sure that when you set the contents of your HTML window to
> include an html header which contains:
> 
> <head>
> ....
> <meta http-equiv="Content-Type" content="text/html; charset=XXXXXXXXX">
> <title>...</title>
> </head>
> 
> with your charset modified to a suitable encoding, it should work. At least,
> that's how I got it to work on my system.

well, i made this little method:

def setHTMLHelp(self, html):
	encoding = sys.getdefaultencoding()
	html = '%s%s%s%s%s' % (
                '<html><head><meta http-equiv="Content-Type" content="text/html; charset=',
		encoding,
		'" /></head><body>',
		html,
		'</body></html>')
	print html
	self.htmlDisplay.SetPage(html)

and it still doesn't work. Hmm no idea what might be wrong. Default
system encoding seems to be ascii, if that's of any help.

Regards
Milos




More information about the wxpython-users mailing list