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

Richard Hainsworth richard at rusrating.ru
Mon Dec 4 06:23:02 PST 2006


Thanks for the responses from Julian, Vadim and Vaclav.

I had picked up the reference to non-unicode builds from other emails 
when researching the error. I checked -
I AM using a unicode build! And I am still getting the error. I keep 
trying to tell you: I get the warning, but the Cyrillic characters come 
out properly (the usual encoding symptoms are funny characters in 
extended ASCII, or question marks for unrecognised characters, but none 
of these occurred).

So I get (for plain ASCII and for blank strings!!!???) a warning about 
not being able to display 8859-1 coding. I dont want to use 8859-1 
coding. I want to use Unicode, and the widget properly displays unicode, 
but I get this damned stupid warning!!!! I want to get rid of the 
warning cos its not telling me anything useful.

May be the following has some relevance - my locale is set to 
"en_GB.UTF-8" (all the locale variables). In this way I get English help 
strings, but I can also see Cyrillics.

By the way, I have tried embedding the strings to be sent to the 
HtmlListBox in a variety of meta tabs, eg:
<html><head><meta ...></head><body>{string}</body></html>
<head><meta ...></head><body>{string}</body>
<meta ...>{string}
via the OnGetItem function.
Nothing gets rid of the pesky warning.

Regards,
Richard

Julian Smart wrote:
> 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
>>
>>
>>
>
>
>
>
> ---------------------------------------------------------------------
> 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