[PATCH 1/4] hhctrl.ocx: Add HTML to Unicode decoding capability (try 3).
jacek at codeweavers.com
Wed Jun 13 03:34:26 CDT 2012
On 06/12/12 19:03, Erich E. Hoover wrote:
> Real Name:
> Erich Hoover
> This patch adds the ability in HTML Help to convert HTML encoded
> characters (e.g. ê) into the Unicode character equivalent. This
> feature is needed by the table of contents and the index for
> displaying international characters in some CHM files. With this
> version of the patch the decoding is done manually by parsing the HTML
> characters instead of using the web browser control, the search is a
> now a binary search, and some additional cleanup. It is important to
> note that HTML Help only supports characters within the ANSI code
> pages, so support for multi-byte characters is not necessary. Many
> apologizes to Jacek Caban for missing some of his comments in his
> original reply.
> hhctrl.ocx: Add HTML to Unicode decoding capability.
The patch looks much better. There is one remaining problem:
+ int pos = sizeof(html_encoded_symbols)/sizeof(html_encoded_symbols);
+ float step = pos/2;
+ int dir = +1;
+ const char *encoded_symbol;
+ pos += -dir*ceil(step);
Using float here is definitely not needed, esp. that you always use
ceil() on it. You've made it more complicated than it really is. See 
for an example. Also feel free to send linear search with FIXME comment.
That's fine for the first iteration patch.
More information about the wine-devel