Error: Failed to display HTML document in ISO-8859-1 encoding

Julian Smart julian at anthemion.co.uk
Mon Dec 4 00:28:11 PST 2006


Hi,

Although the docs say charset information isn't required, perhaps you 
can add it to your HTML to see if it helps, e.g.:

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-5">
 </head>

Also, this problem only happens in non-Unicode mode (see 
src/html/winpars.cpp and the !wxUSE_UNICODE guards around 
SetInputEncoding that has the offending wxLogError call). Any reason why 
you're not using Unicode builds, if you're writing apps that use Cyrillic?

However it would be useful to have wxHtmlListBox::SetEncoding. I've 
added this to CVS, with a call to SetInputEncoding in 
src/generic/htmllbox.cpp, so if you can apply these changes to your 
wxWidgets source tree, you could try calling SetEncoding with 
wxFONTENCODING_ISO8859_5. See:

http://cvs.wxwidgets.org/viewcvs.cgi/wxWindows/include/wx/htmllbox.h.diff?r1=1.20&r2=1.21

http://cvs.wxwidgets.org/viewcvs.cgi/wxWindows/src/generic/htmllbox.cpp.diff?r1=1.26&r2=1.27

Regards,

Julian

Richard Hainsworth wrote:
> On further experimentation, I found
> a) the error arose when the HtmlListBox is initiated, even if the 
> strings to be placed in the lines are blank - viz no characters at all!
> b) Using LogNull (as suggested by another user) does not kill the 
> warnings until after the start-up sequence.
> c) The only way to kill the initial warning is to use SetItemCount(0) 
> on the listbox, so that nothing is written to the Html box.
>
> Firstly. There is no real problem that I can find! Other than a pesky 
> warning. Hence my original point about it being a useless warning. Can 
> the code that generates the warning just get deleted?
>
> My feeling is that it is not an OnGetEncoding method that is needed, 
> but a SetCoding method associated with the widget, in the same way as 
> there is SetItemCount. The Enconding attribute must be set somewhere 
> for it to be checked and for a error to be raised.
>
> Note too, that in looking through the emails I have found this problem 
> occuring in a number of places, without anyone providing a workaround. 
> Some of the emails seem to be on sites of products that use wxWidgets.
>
> How soon could a method be developed or the warning quashed?
>
> Richard
>
>
> Vadim Zeitlin wrote:
>> On Sun, 03 Dec 2006 14:09:38 +0300 Richard Hainsworth 
>> <richard at rusrating.ru> wrote:
>>
>> RH> c) wxHtmlListBox has to be subclassed and the function RH> 
>> wxHtmlListBox::OnGetItem has to be implemented. Here is the text from 
>> RH> the online manuals:
>> ...
>> RH> Note that without <html><body> and hence no <head> tags, there is 
>> no way RH> to provide <meta> information to the renderer.
>>
>>  Indeed, there is a problem here. We should either deduce the charset
>> from the listbox font encoding (which would only allow using the same
>> charset for all items) or add OnGetEncoding(n) method. In either case
>> I unfortunately don't see any workaround for this problem right now...
>>
>>  Regards,
>> VZ
>>
>>   
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wx-users-unsubscribe at lists.wxwidgets.org
> For additional commands, e-mail: wx-users-help at lists.wxwidgets.org
>
>
>







More information about the wx-users mailing list