Fork 0
Go to file
Kalle Olavi Niemitalo 4a5af7fd26 Bug 381: Store codepage-to-Unicode mappings as dense arrays.
Previously, each mapping between a codepage byte and a Unicode
character was stored as a struct table_entry, which listed both the
byte and the character.  This representation may be optimal for sparse
mappings, but codepages map almost every possible byte to a character,
so it is more efficient to just have an array that lists the Unicode
character corresponding to each byte from 0x80 to 0xFF.  The bytes are
not stored but rather implied by the array index.  The tcvn5712 and
viscii codepages have a total of four mappings that do not fit in the
arrays, so we still use struct table_entry for those.

This change also makes cp2u() operate in O(1) time and may speed up
other functions as well.

The "sed | while read" concoction in Unicode/gen-cp looks rather
unhealthy.  It would probably be faster and more readable if rewritten
in Perl, but IMO that goes for the previous version as well, so I
suppose whoever wrote it had a reason not to use Perl here.


   text	   data	    bss	    dec	    hex	filename
  38948	  28528	   3311	  70787	  11483	src/intl/charsets.o
 500096	  85568	  82112	 667776	  a3080	src/elinks


   text	   data	    bss	    dec	    hex	filename
  31558	  28528	   3311	  63397	   f7a5	src/intl/charsets.o
 492878	  85568	  82112	 660558	  a144e	src/elinks

So the text section shrank by 7390 bytes.

Measured on i686-pc-linux-gnu with: --disable-xbel --disable-nls
--disable-cookies --disable-formhist --disable-globhist
--disable-mailcap --disable-mimetypes --disable-smb --disable-mouse
--disable-sysmouse --disable-leds --disable-marks --disable-css
--enable-small --enable-utf-8 --without-gpm --without-bzlib
--without-idn --without-spidermonkey --without-lua --without-gnutls
--without-openssl CFLAGS="-Os -ggdb -Wall"
2006-09-24 16:55:29 +03:00
Unicode Bug 381: Store codepage-to-Unicode mappings as dense arrays. 2006-09-24 16:55:29 +03:00
config Show dots after UTF-8. Taken from Jonas's mail 2006-07-21 14:37:46 +02:00
contrib Minor optimization in hooks.py 2006-09-02 12:26:55 +02:00
debian Autogenerate .vimrc files and put the master in config/vimrc 2006-01-15 18:38:58 +01:00
doc Update SpiderMonkey instructions to reflect current features summary 2006-07-06 17:34:52 +00:00
po French translation was updated. 2006-09-03 15:22:38 +02:00
src Bug 381: Store codepage-to-Unicode mappings as dense arrays. 2006-09-24 16:55:29 +03:00
test ECMAScript: More accessKey tests. 2006-08-20 17:07:26 +03:00
.gitignore Autogenerate .vimrc files and put the master in config/vimrc 2006-01-15 18:38:58 +01:00
ABOUT-NLS Initial commit of the HEAD branch of the ELinks CVS repository, as of 2005-09-15 15:58:31 +02:00
AUTHORS Merge with http://www.fi.muni.cz/~xbabinc/elinks/elinks-utf8.git/ 2006-07-25 09:59:12 +02:00
BUGS Drop .or from elinks.or.cz. 2005-12-29 04:35:02 +00:00
COPYING Clarify the GPL upgrades policy a bit, and propose an addition 2005-09-17 03:33:36 +02:00
ChangeLog Tidyup. 2006-02-23 00:57:44 +01:00
INSTALL Remove some suspiciously looking empty lines 2006-01-19 02:23:01 +01:00
Makefile Regenerate Makefile.config automatically if config.status has changed. 2005-12-06 14:59:06 +01:00
Makefile.config.in Define datarootdir in Makefile.config.in, for better Autoconf compatibility. 2006-09-17 17:55:53 +03:00
Makefile.lib Added uninstall target to the Makefile. 2006-09-03 09:27:21 +02:00
NEWS List native FSP protocol, SEE ecmascript and crappy RSS renderer under NEWS 2006-01-22 06:20:58 +01:00
README Drop .or from elinks.or.cz. 2005-12-29 04:35:02 +00:00
SITES Remove Cygwin binary address (returns 404) 2005-12-20 03:49:19 +01:00
THANKS Drop .or from elinks.or.cz. 2005-12-29 04:35:02 +00:00
TODO Drop .or from elinks.or.cz. 2005-12-29 04:35:02 +00:00
autogen.sh We loves us some autoheader 2005-09-27 23:23:38 +02:00
configure.in Fix spelling in the "Python support is incomplete" warning. 2006-09-17 17:32:07 +03:00
features.conf Rename CONFIG_UTF_8 to CONFIG_UTF8. 2006-09-17 16:12:47 +03:00


ELinks - an advanced web browser

ELinks is an advanced and well-established feature-rich text mode web
(HTTP/FTP/..) browser. ELinks can render both frames and tables, is highly
customizable and can be extended via scripts. It is very portable and runs
on a variety of platforms.

The ELinks official website is available at


Please see the SITES file for mirrors or other recommended sites.  If you
want to install ELinks on your computer, see the INSTALL file for further

A good start point is documentation files available in doc/, especially the
file named index.txt.

If you want to request features or report bugs, see community information at
http://elinks.cz/community.html and feedback information available at

If you want to write some patches, please first read the doc/hacking.txt

If you want to add a new language or update the translation for an existing
one, please read po/README document.

If you want to write some documentation, well, you're welcome! ;)

Historical notes

Initially, ELinks was a development version of Links (Lynx-like text WWW
browser), with more liberal features policy and development style.  Its purpose
was to provide an alternative to Links, and to test and tune various new
features, but still provide good rock-solid releases inside stable branches.

Why not contribute to Links instead?  Well, first I made a bunch of patches for
the original Links, but Mikulas wasn't around to integrate them, so I started
releasing my fork. When he came back, a significant number of them got refused
because Mikulas did not like them, as he just wouldn't have any use for them
himself.  He wants to keep Links with a relatively closed feature set and merge
only new features which he himself needs.  It has advantages that the tree is
very narrow and the code is small and contains very little bloat.

ELinks, on the contrary, aims to provide a full-featured web browser, superior
to both lynx and w3m and with the power (but not slowness and memory usage) of
Mozilla, Konqueror and similar browsers. However, to prevent drastic bloating
of the code, the development is driven in the course of modularization and
separation of add-on modules (like cookies, bookmarks, ssl, scripting etc).

For more details about ELinks history, please see


If you are more interested in the history and various Links clones and versions,
you can examine the website at


vim: textwidth=80