mirror of https://github.com/rkd77/elinks.git synced 2024-06-13 23:20:53 +00:00
Commit Graph

161 Commits

Author SHA1 Message Date
Witold Filipczyk
3d96b0d7d7 Revert "Compile with C++."
This reverts commit 4f4df33638.
2019-04-21 12:27:40 +02:00
Witold Filipczyk
4f4df33638 Compile with C++.
Weak points:
- alignof
- js problems

- make js work with C++ and mozjs-17
- then mozjs-24
- then mozjs-52
- then mozjs-60
- decrease number of warnings
2019-02-17 20:46:16 +01:00
Felix Janda
ca44c53f59 Make Japanese language selectable 2017-11-23 18:53:15 -05:00
Felix Janda
06832623ad Rename configure.in to configure.ac
Avoids aclocal warning
2017-11-22 17:01:48 -05:00
Marco Migliori
5e31308da0 text direction mark 2017-05-16 20:57:25 +02:00
Witold Filipczyk
38c12d9dfc Compilation fix 2016-04-24 17:36:20 +02:00
Witold Filipczyk
3212ee4e54 C++ comaptibility 2016-04-24 17:23:58 +02:00
Witold Filipczyk
257422f28c Reorganisation of code to make C++ happy 2016-04-20 22:21:31 +02:00
Witold Filipczyk
da15322705 Cast to (const char *) in strrchr calls 2016-04-20 21:03:27 +02:00
Witold Filipczyk
96e65c105f Explicit cast in strstr for C++ 2016-04-20 20:46:33 +02:00
Witold Filipczyk
52d6f37c8e Explicit cast to (const char *) for strchr function (C++) 2016-04-20 19:43:37 +02:00
Witold Filipczyk
67673f5fe5 new -> new_ for C++ compatibility 2016-04-20 18:42:22 +02:00
Witold Filipczyk
f778e66d88 Changes to let it build with bison-3.0. 2015-02-25 21:16:09 +01:00
Bin Guo
7553d321a1 Fixed problem of converting more thant 256 chars. 2014-06-26 21:21:59 +02:00
7dd4d9b737 iconv: Bail out of the loop when an illegal sequence of bytes occurs.
Before, with the default codepage GB2312 and a mysql sql dump in UTF-8
I got segfaults in the iconv related code.
2013-02-27 09:33:55 +01:00
Techlive Zheng
0ba951021a Elinks currently only support GB2312 as Chinese encoding, but GBK and
GB18030 are also widely used. Codepage CP936 is almost identical to
GBK, so I add it as an alias.
2013-01-20 12:58:03 +01:00
c656c5c929 Pass -Wno-uninitialized for the gettext compilation.
The compilation --with-debug failed on the plural.c.
2011-10-08 12:07:02 +02:00
Kalle Olavi Niemitalo
f735bfbe72 I18N bug 1112: Use strange_chars[] for UTF-8 output too
Make u2cp_() map code points U+0080 to U+009F via strange_chars[] even
if the target codepage is UTF-8.  This helps with buggy web pages that
use ’ when they mean ’.  This change does not affect how
ELinks decodes raw bytes 0x80 to 0x9F in HTML.

u2cp_() is used only via the u2cp and u2cp_no_nbsp macros.
Possible side effects of this change at each use of these macros:

* get_translation_table(): Not affected because it does not call u2cp
  if the target codepage is UTF-8.
* get_entity_string(): Numeric character references are affected, as intended.
  Character entity references are not affected because entities[]
  does not define any entities in the U+0080...U+009F range.
* kbd_field(), term_send_ucs(), field_op(): Affected.  It is no longer
  possible to enter code points U+0080...U+009F from the terminal.
  This should not be a problem in practice because those would be
  control characters anyway and should therefore be filtered by the
  slave process (which doesn't yet recognize them; bug 777).
2011-04-17 21:24:26 +03:00
Witold Filipczyk
a9c02bbf01 Additional check whether LANGUAGE is not NULL. 2010-09-19 15:29:55 +02:00
Witold Filipczyk
f93d5ccd80 Revert "strcpy -> strlcpy."
This reverts commit 365cbb61be.
There is no strlcpy in libc.
2010-09-19 15:26:05 +02:00
365cbb61be strcpy -> strlcpy.
Some of these changes doesn't make sense, but warnings are avoided.
2010-09-19 15:16:00 +02:00
Witold Filipczyk
d74b9b932f More charsets. 2010-07-24 12:37:29 +02:00
Witold Filipczyk
7c9e858723 Added Shift-JIS charset. 2010-07-24 10:43:42 +02:00
Witold Filipczyk
958cc8dbbc Treat Big5 as Big5-hkscs. 2010-07-24 10:39:18 +02:00
Witold Filipczyk
90b37ff15f Reset iconv_cp when switching from Big5 -> UTF-8 to UTF-8 -> UTF-8.
After viewing a page with Big5 charset and next a page with UTF-8
charset iconv was used, so slows down a bit.
Now iconv is used only for those charsets, which has the iconv
bitfield set.
2010-07-24 09:57:59 +02:00
Witold Filipczyk
6d567bb8ce Support for multibyte encodings using iconv.
New charsets must be added by analogy to Big5.
2010-07-23 19:59:59 +02:00
Witold Filipczyk
b50fd4e8e2 codepage_desc: added the iconv bitfield.
I'm going to use it later for multibyte encodings, such as Big5.
2010-07-23 15:44:12 +02:00
Kalle Olavi Niemitalo
683cfe4c86 Merge branch 'elinks-0.12' into elinks-0.13
	NEWS: merged
	configure.in: VERSION changed in elinks-0.12; kept 0.13.GIT
	doc/man/man1/elinks.1.in: regenerated
	doc/man/man5/elinks.conf.5: regenerated
	doc/man/man5/elinkskeys.5: regenerated
	po/fr.po: kept 0.13.GIT
	po/pl.po: kept 0.13.GIT
2009-05-31 16:18:23 +03:00
Kalle Olavi Niemitalo
b6aca8d9a7 Add tests for utf8_step_forward
I am not hooking these to "make test", for two reasons:

1. utf8_step_forward is inside #ifdef CONFIG_UTF8 and I don't see
   how to make tests conditional on such options.

2. test/libtest.sh was copied from Git, which is under GPLv2-only.
   Adding more dependencies on it could make ELinks more difficult
   to relicense under GPLv2-or-later.
2009-05-27 01:11:03 +03:00
Kalle Olavi Niemitalo
6d7b904fe3 Don't overcount in utf8_step_forward
Reported by witekfl.
2009-05-27 01:11:02 +03:00
Kalle Olavi Niemitalo
82e67f8ebc Merge branch 'elinks-0.12' into elinks-0.13
2009-05-21 19:50:16 +03:00
Kalle Olavi Niemitalo
0c756fc3e8 TRE: Check for 32-bit wchar_t at configure time
This check used to be in src/elinks.h.  Move it to configure.in so
that (1) the result can be logged and (2) ELinks won't even link with
TRE if wchar_t prevents its use.

Also, rename HAVE_TRE_REGEX_H to CONFIG_TRE, to reflect that it is not
always defined if the header exists.
2009-05-21 17:22:12 +03:00
Kalle Olavi Niemitalo
34f8f6a58f Merge branch 'elinks-0.12' into master
	NEWS (merged)
	configure.in (merged)
	doc/man/man1/elinks.1.in (regenerated)
	doc/man/man5/elinks.conf.5 (regenerated)
	doc/man/man5/elinkskeys.5 (regenerated)
	po/af.po (used elinks-0.12)
	po/be.po (used elinks-0.12)
	po/bg.po (used elinks-0.12)
	po/ca.po (used elinks-0.12)
	po/cs.po (used elinks-0.12)
	po/da.po (used elinks-0.12)
	po/de.po (used elinks-0.12)
	po/el.po (used elinks-0.12)
	po/es.po (used elinks-0.12)
	po/et.po (used elinks-0.12)
	po/fi.po (used elinks-0.12)
	po/fr.po (used master)
	po/gl.po (used elinks-0.12)
	po/hr.po (used elinks-0.12)
	po/hu.po (used elinks-0.12)
	po/id.po (used elinks-0.12)
	po/is.po (used elinks-0.12)
	po/it.po (used elinks-0.12)
	po/lt.po (used elinks-0.12)
	po/nb.po (used elinks-0.12)
	po/nl.po (used elinks-0.12)
	po/pl.po (used master)
	po/pt.po (used elinks-0.12)
	po/pt_BR.po (used elinks-0.12)
	po/ro.po (used elinks-0.12)
	po/ru.po (used elinks-0.12)
	po/sk.po (used elinks-0.12)
	po/sr.po (used elinks-0.12)
	po/sv.po (used elinks-0.12)
	po/tr.po (used elinks-0.12)
	po/uk.po (used elinks-0.12)
2009-03-29 18:26:20 +03:00
Kalle Olavi Niemitalo
d7d18e4e43 bug 1047: inline functions C99 conformance
C99 6.7.4p3 and 6.7.4p6 set some constraints on what can be done in
inline functions and how they can be declared.  In particular, any
function declared inline must also be defined in the same translation
unit.  To comply with that, remove inline specifiers from function
declarations in header files when the functions are not also defined
in those header files.

Sun Studio 11 on Solaris 9 is stricter than C99 and does not allow
references to static identifiers in extern inline functions.  Make the
configure script detect this and define NONSTATIC_INLINE accordingly
in config.h.  Then use that in the definitions of all non-static
inline functions.

Document the restrictions and this scheme in doc/hacking.txt.
2009-03-28 20:15:08 +02:00
Kalle Olavi Niemitalo
d2854dca8d Merge branch 'elinks-0.12' into elinks-0.13
2009-02-08 22:02:57 +02:00
Kalle Olavi Niemitalo
73f925ce21 bug 153, 1066: Convert XBEL bookmarks to/from UTF-8.
When the file is being read, Expat provides the strings to ELinks in
UTF-8, so ELinks can put them in struct bookmark without conversions.
Make sure gettext returns any placeholder strings in UTF-8, too.
Replace '\r' with ' ' in bookmark titles and URLs.

When the file is being written, put encoding="UTF-8" in the XML
declaration, and then write out the strings from struct bookmark
without character set conversions.  Do replace some characters
with entity references though, by calling add_html_to_string().
2009-02-08 18:26:04 +02:00
Witold Filipczyk
39c6589edb Added the get_cp_highhalf function, which will be used by xhtml. 2009-01-26 21:11:14 +01:00
Kalle Olavi Niemitalo
9088f11c64 Make encode_utf8() extern even without CONFIG_UTF8.
It will soon be needed for conversions from UTF-16 to UTF-8.
2009-01-04 16:55:24 +02:00
Kalle Olavi Niemitalo
687f19dbde Merge branch 'elinks-0.12' into elinks-0.13

And a semantic conflict in src/terminal/terminal.c.
2009-01-01 19:14:01 +00:00
Kalle Olavi Niemitalo
8f4d7f9903 Define cp_to_unicode() even without CONFIG_UTF8.
And make its last parameter point to const.  add_cp_html_to_string()
no longer needs to pretend UTF-8 is ISO-8859-1.
2009-01-01 16:17:03 +00:00
Kalle Olavi Niemitalo
ad45176dde Add get_terminal_codepage().
This simplifies the callers a little and may help implement
simultaneous support for different charsets on different terminals
of the same type (bug 1064).
2009-01-01 16:16:17 +00:00
Miciah Dashiel Butler Masters
b9b2b75f73 Drop zero-initialisation of static storage
In get_entity_string and point_intersect, do not initialise arrays with
static storage duration to zero; the C standard states that such objects
are automatically initialised to zero.
2008-12-27 05:32:36 +00:00
Kalle Olavi Niemitalo
5c2fada371 Merge branch 'elinks-0.12' into elinks-0.13
2008-11-01 22:39:17 +02:00
Kalle Olavi Niemitalo
aaf6be8a36 Bug 1004: Fix implicit declarations of c_* functions
Add #include directives to fix these errors:

      [CC]   src/intl/gettext/l10nflist.o
cc1: warnings being treated as errors
.../src/intl/gettext/l10nflist.c: In function ‘_nl_normalize_codeset’:
.../src/intl/gettext/l10nflist.c:352: error: implicit declaration of function ‘c_tolower’

      [CC]   src/dom/css/scanner.o
cc1: warnings being treated as errors
In file included from .../src/dom/scanner.h:4,
                 from .../src/dom/css/scanner.h:4,
                 from .../src/dom/css/scanner.c:12:
.../src/dom/string.h: In function ‘dom_string_casecmp’:
.../src/dom/string.h:34: error: implicit declaration of function ‘c_strncasecmp’
2008-11-01 22:27:08 +02:00
M. Vefa Bicakci
96b3093519 Patch 2: Modifications to the remaining parts of ELinks
[Forward ported to 0.12 from bug 1004 attachment 499.  --KON]
2008-11-01 22:20:25 +02:00
Kalle Olavi Niemitalo
776eff90e1 Merge branch 'elinks-0.12' into elinks-0.13 2008-10-15 23:34:27 +03:00
Kalle Olavi Niemitalo
12d66ff043 Bug 932: Redisable 0x80...0x9F mappings in some charsets.
Bug 932 is about ELinks letting control characters 0x80...0x9F through
to the terminal.  It did not occur with ISO 8859-1, 8859-2, 8859-15,
or 8859-16, because the ELinks mappings for those charsets did not
include those bytes.  However, the www.unicode.org versions imported
in the previous commit do include the problematic bytes.

To avoid a possible regression before the ELinks 0.12.0 release,
comment those control-character mappings out again.  This workaround
should be reverted after bug 932 has been fixed properly.
2008-10-11 15:35:34 +03:00
Kalle Olavi Niemitalo
c9ca6fd448 Refresh charsets from www.unicode.org.
Add copyright and licence notices, and a NEWS entry.

The data in the new versions is not entirely the same as what ELinks
used to have:

- Unicode/8859_1.cp: Adds control characters.
- Unicode/8859_2.cp: Adds control characters.
- Unicode/8859_4.cp: Adds some control characters that ELinks assumed
  there already.
- Unicode/8859_7.cp: Adds three characters.
- Unicode/8859_15.cp: Adds control characters.
- Unicode/8859_16.cp: Adds control characters and swaps 0xA5 with 0xAB.
- Unicode/koi8_r.cp: Changes 0x95 and adds some control characters
  that ELinks assumed there already.
- Unicode/macroman.cp: Changes 0xC6 and removes some control characters
  that ELinks assumes there anyway.
2008-10-11 15:35:09 +03:00
Kalle Olavi Niemitalo
5499926cc0 Merge branch 'elinks-0.12' into elinks-0.13

2008-02-03 22:30:46 +02:00
Kalle Olavi Niemitalo
11e9a816f5 const in name_to_language 2008-02-03 14:42:07 +02:00