Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 116785 - www-client/dillo - on big-endian platforms, entities do not appear
Summary: www-client/dillo - on big-endian platforms, entities do not appear
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: PPC Linux
: High normal (vote)
Assignee: Mamoru KOMACHI (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-12-26 08:00 UTC by Rudolf Polzer
Modified: 2006-03-24 04:49 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rudolf Polzer 2005-12-26 08:00:50 UTC
dillo-i18n-misc had a bug in handling entities like > in websites: on PPC and most probably other big-endian platforms, entities do not appear (it is an accidental double endianness conversion).

It's fixed upstream in dillo-i18n-misc-20051207 or perhaps earlier (I don't know, it was me who submitted bug and patch to the maintainer of the patchset, but forgot when it was fixed); later I installed Gentoo and wondered why I still see my old bug ;)

The bug can be fixed by either upgrading the version of the patchset (which I'd prefer) or by adding this small change to html.c (quoting my own mail to the patchset maintainer):

> Given the entity &x1234;, isocode is 0x1234. Then html.c will do the following:
> 
> 1167          guint ucs2le = GUINT_TO_LE((guint)isocode);
> 1168          gchar wc[3] = {((gchar)ucs2le<<8)>>8, ucs2le>>8, 0};
> 
> On a little endian platform, GUINT_TO_LE does absolutely nothing and given (for
> example) 0x1234 in isocode, this will calculate wc to {0x34, 0x12, 0}.
> 
> However, on a big endian platform, given 0x1234 in isocode, this will result in
> ucs2le being 0x34120000 and therefore wc will end up being {0x00120000,
> 0x00341200} which collapses to {0, 0, 0} given 8bit chars. I think line 1167 
> should be removed altogether since line 1168 does the actual conversion to
> little endian.
> 
> And I think the two shifts are not necessary, but don't hurt. I'd have written
> instead:
> 
> 1168          gchar wc[3] = {(gchar)isocode, (gchar)(isocode>>8), 0};
>
> Now it works here and should still be equivalent on x86,
Comment 1 Mamoru KOMACHI (RETIRED) gentoo-dev 2006-03-24 04:49:44 UTC
Sorry for the delay. I updated i18n-misc patchset to 20060104,
so it should be fixed now. Thanks for the bug report.