]> jfr.im git - irc/weechat/weechat.git/commit
core: improve case convert and insensitive char comparisons (closes #258)
authorSébastien Helleu <redacted>
Wed, 21 Dec 2022 18:23:29 +0000 (19:23 +0100)
committerSébastien Helleu <redacted>
Wed, 21 Dec 2022 19:49:09 +0000 (20:49 +0100)
commit68b510517e7a14b2d2457f8437e9291b87e0d1d5
treea3fae5b8673ec860f49315bb1b0ec72e74cf54d1
parent95286c1eb362cedb767597ea23fb29d6455f6b94
core: improve case convert and insensitive char comparisons (closes #258)

All lowercase letters are now properly converted to uppercase letters (and vice
versa), via functions `towupper` and `towlower`.

Functions `string_tolower`, `string_toupper` and `utf8_charcasecmp` have been
optimized to be faster when there are ASCII chars (< 128); functions are about
25-40% faster with mixed chars (both ASCII and multi-bytes).

Function `utf8_wide_char` has been removed, `utf8_char_int` can be used
instead.
13 files changed:
ChangeLog.adoc
doc/en/weechat_plugin_api.en.adoc
doc/fr/weechat_plugin_api.fr.adoc
doc/it/weechat_plugin_api.it.adoc
doc/ja/weechat_plugin_api.ja.adoc
doc/sr/weechat_plugin_api.sr.adoc
src/core/wee-config.c
src/core/wee-string.c
src/core/wee-utf8.c
src/core/wee-utf8.h
tests/unit/core/test-core-eval.cpp
tests/unit/core/test-core-string.cpp
tests/unit/core/test-core-utf8.cpp