[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lmi] Non-ASCII characters in wx html help
From: |
Vaclav Slavik |
Subject: |
Re: [lmi] Non-ASCII characters in wx html help |
Date: |
Thu, 13 Mar 2008 15:18:28 +0100 |
User-agent: |
KMail/1.9.9 |
Hi,
Greg Chicares wrote:
> Is there any easy way to get html help to support more non-ASCII
> characters? I'm particularly interested in
> …
> — –
> ‘ ’
> “ ”
> because they make text look more professional.
All of these entities (together with the rest of what HTML4 defines)
are already supported. The problem here is the use of ANSI build of
wxWidgets. In ANSI build, wxHTML uses single charset for fonts on the
entire page (in could in theory fragment the text into chunks in one
8bit charset, but it would complicate and slow down the code a lot)
and assumes that Content-Type header specifies charset suitable for
the content.
And that's the problem here: LMI's HTML files specify Content-Type
as "text/html; charset=iso-8859-1", so wxHTML uses iso-8859-1 for the
entire page. And none of the characters above are present in
iso-8859-1, so it fails to display them.
The fix is as simple as changing the charset to "windows-1252" (this
will work in wxGTK too). Using an UTF-8 encoding wouldn't help,
wxHTML wouldn't be able to determine encoding to use for the fonts
(it can't be UTF-8 on Windows) from Content-Type and would fall back
to Latin1. (In wx3, you will be able to use Unicode build without
changes to LMI code, so the problem will disappear.)
> I'd also like to know whether I can get a physical tab character
> to render as such (rather than as spaces).
Not currently, but I can [try to] implement it. wxHTML translates tabs
inside <pre> into series of characters, so it would need to be
changed to do this later, when rendering (apparently, that's what
Firefox does).
> that worked only within <pre>...</pre>.
That's the only place where it can work, I think. wxHTML doesn't
implement CSS and so white-space:pre can't be used and without it,
whitespace is normalized.
Regards,
Vaclav
--
PGP key: 0x465264C9, available from http://pgp.mit.edu/