History log of /dovecot/src/lib/unichar.h
Revision Date Author Comments Expand
c47167da2f6443479e5c44ab31d2974252abdfd8 23-Oct-2017 Aki Tuomi <aki.tuomi@dovecot.fi>

unichar: Use surrogate macros in ucs4 validity check

2bb5b6721e9971b3bcbb2da48eebead7fd9488ee 23-Oct-2017 Aki Tuomi <aki.tuomi@dovecot.fi>

unichar: Add surrogate handling

5fc1d7c7caffa7e5616a1681503dfea0fc582aae 23-Oct-2017 Aki Tuomi <aki.tuomi@dovecot.fi>

unichar: Add uni_is_valid_ucs4

3b02371c120dcd455a09148abc5a3f520880fef2 03-Jun-2015 Timo Sirainen <tss@iki.fi>

lib: Added UTF8_IS_START_SEQ() helper macro

304a9d2db2669ad910577e00dce2f81bfd0d5d39 01-Jun-2015 Phil Carmody <phil@dovecot.fi>

lib: API change - have uni_utf8_get_char*() return _char_bytes Often the two functions are called in close proximity (both ways round). As _get_char*() calls _char_bytes() early on the success path, we may as well return that value to the caller for immediate use. The callers which call _char_bytes() first are simply rejecting the truncated case quickly - all other invalid cases still call both functions, and all other valid cases (which should be the fast path) likewise call both. Signed-off-by: Phil Carmody <phil@dovecot.fi>

c8b84f03c71e18f07940d1b60a77a4caf5e7c23b 16-May-2015 Timo Sirainen <tss@iki.fi>

lib: Added UNICODE_REPLACEMENT_CHAR_UTF8

32ae620015da6ab2ec28e04d3cdcdb4420f1fa6b 15-Jan-2015 Timo Sirainen <tss@iki.fi>

lib: Fixed NUL-handling in uni_utf8_*strlen*() uni_utf8_strlen() could have skipped over the ending NUL byte and caused read buffer overflows with invalid input. uni_utf8_strlen_n() and uni_utf8_partial_strlen_n() now allow NUL bytes in the input and they're treated as regular control characters. Previously the size was actually treated as max_size with early NUL byte termination. Technically this is an API change, but I'm not aware of anything using these functions in an incompatible way.

f66c8939c39e6bcd9dd5482bfd9689bd177ce0d4 10-Jan-2015 Timo Sirainen <tss@iki.fi>

lib: Added uni_utf8_partial_strlen_n()

c51afc0ab251923fbfcad5059af27a7fefab3502 27-Nov-2012 Timo Sirainen <tss@iki.fi>

Reversed recent "short utf8" changes. Solr code needs to parse the UTF8 input explicitly anyway to encode the XML characters. And all the character checks were already done in it.

cb0b320bea887d305e0e283c6bc74677d51a785e 27-Nov-2012 Timo Sirainen <tss@iki.fi>

liblib: Added uni_utf8_short_*() for handling UTF8 data where [56]-byte sequences are invalid.

d74c9540cd64888055c4840a4544b1de4248e584 18-Sep-2012 Timo Sirainen <tss@iki.fi>

Backported parts of normalizer_func_t changes from v2.2 tree.

d9076f5939edf5d20a261494b1a861dcbb0d32e2 15-Sep-2012 Timo Sirainen <tss@iki.fi>

Replaced "decomposed titlecase" conversions with more generic normalizer function. Plugins can now change mail_user.default_normalizer. Specific searches can also use different normalizers by changing mail_search_context.normalizer.

/dovecot/src/doveadm/doveadm-mail-fetch.c /dovecot/src/lib-charset/charset-iconv.c /dovecot/src/lib-charset/charset-utf8.c /dovecot/src/lib-charset/charset-utf8.h /dovecot/src/lib-imap/imap-base-subject.c /dovecot/src/lib-mail/message-decoder.c /dovecot/src/lib-mail/message-decoder.h /dovecot/src/lib-mail/message-header-decode.c /dovecot/src/lib-mail/message-header-decode.h /dovecot/src/lib-mail/message-search.c /dovecot/src/lib-mail/message-search.h /dovecot/src/lib-mail/test-message-decoder.c /dovecot/src/lib-mail/test-message-header-decode.c /dovecot/src/lib-storage/index/index-search.c /dovecot/src/lib-storage/mail-storage-private.h /dovecot/src/lib-storage/mail-user.c /dovecot/src/lib-storage/mail-user.h unichar.h /dovecot/src/plugins/fts-squat/fts-backend-squat.c /dovecot/src/plugins/fts/fts-api-private.h /dovecot/src/plugins/fts/fts-api.c /dovecot/src/plugins/fts/fts-build-mail.c
3412b625dd238cc0774db968e6c351b007a98e25 15-Sep-2012 Timo Sirainen <tss@iki.fi>

uni_utf8_to_decomposed_titlecase(): Require input length to be exact now. Most of the callers did that already anyway

88311240b8db117b120171a861a64e399dab57af 22-Jul-2011 Timo Sirainen <tss@iki.fi>

Added uni_utf8_strlen().

c6ead31ba07401556abe0c69374d7fbed99844e7 31-May-2011 Timo Sirainen <tss@iki.fi>

liblib: Added uni_utf8_to_ucs4_n().

296857bde8dbe965bcfe5e96cf06d37c297d9315 18-Feb-2011 Timo Sirainen <tss@iki.fi>

Added uni_utf8_data_is_valid().

f2de6ecc4424533633aea705f12d0f691d7ddf81 20-Aug-2010 Timo Sirainen <tss@iki.fi>

Added a global utf8_replacement_char variable.

a0044466cc46baf25a316ea63781c60aa52b58ca 19-Aug-2010 Timo Sirainen <tss@iki.fi>

UTF-8 string validity was still checked incorrectly.

ef1d718c6a3a3a48b9835b004b8496de9dc4bec5 10-Nov-2009 Timo Sirainen <tss@iki.fi>

Added uni_utf8_str_is_valid(). --HG-- branch : HEAD

0b2b090cdc3d36f30d6d2ec99b35ac0b7657d538 01-Nov-2008 Timo Sirainen <tss@iki.fi>

Added some UTF16_ macros for helping UTF-16 conversions. --HG-- branch : HEAD

68a4946b12583b88fa802e52ebee45cd96056772 20-Jun-2008 Timo Sirainen <tss@iki.fi>

Added more consts, ATTR_CONSTs and ATTR_PUREs. --HG-- branch : HEAD

/dovecot/src/imap/commands-util.c /dovecot/src/imap/commands-util.h /dovecot/src/lib-charset/charset-utf8.h /dovecot/src/lib-imap/imap-bodystructure.c /dovecot/src/lib-imap/imap-bodystructure.h /dovecot/src/lib-mail/message-header-parser.c /dovecot/src/lib-mail/message-header-parser.h /dovecot/src/lib-storage/mail-namespace.c /dovecot/src/lib-storage/mail-namespace.h /dovecot/src/lib-storage/mail-storage.c /dovecot/src/lib-storage/mail-storage.h /dovecot/src/lib-storage/mailbox-list.c /dovecot/src/lib-storage/mailbox-list.h aqueue.h array.c array.h buffer.c buffer.h crc32.h data-stack.h hash.h hex-dec.h istream.c istream.h lib.h network.h ostream-file.c ostream-internal.h ostream.c ostream.h primes.h priorityq.h seq-range-array.h str.h strfuncs.h unichar.h var-expand.h /dovecot/src/login-common/client-common.h /dovecot/src/login-common/login-proxy.c /dovecot/src/login-common/login-proxy.h /dovecot/src/login-common/ssl-proxy-openssl.c /dovecot/src/login-common/ssl-proxy.c /dovecot/src/login-common/ssl-proxy.h
8e9666f46faceeef0f3c6f706f10f3a873e4b0eb 22-Jan-2008 Timo Sirainen <tss@iki.fi>

Replace invalid UTF8 input with a replacement character. --HG-- branch : HEAD

54df49100a0111a956662cb8a327969badd2d72d 27-Dec-2007 Timo Sirainen <tss@iki.fi>

Define unichars array type and use it for uni_utf8_to_ucs4() output. --HG-- branch : HEAD

7aa59f55d8a4e02c7039fbd22660c4055bfc8393 08-Dec-2007 Timo Sirainen <tss@iki.fi>

uni_utf8_get_valid_data() API changed. --HG-- branch : HEAD

511ba4416aafb9f9ba1a4193703b95a033267068 08-Dec-2007 Timo Sirainen <tss@iki.fi>

Moved uni_utf8_get_valid_data() to lib/ --HG-- branch : HEAD

c25356d5978632df6203437e1953bcb29e0c736f 16-Sep-2007 Timo Sirainen <tss@iki.fi>

Changed .h ifdef/defines to use <NAME>_H format. --HG-- branch : HEAD

/dovecot/src/auth/auth-cache.h /dovecot/src/auth/auth-client-connection.h /dovecot/src/auth/auth-client-interface.h /dovecot/src/auth/auth-master-connection.h /dovecot/src/auth/auth-master-interface.h /dovecot/src/auth/auth-master-listener.h /dovecot/src/auth/auth-request-handler.h /dovecot/src/auth/auth-request.h /dovecot/src/auth/auth-stream.h /dovecot/src/auth/auth-worker-client.h /dovecot/src/auth/auth-worker-server.h /dovecot/src/auth/auth.h /dovecot/src/auth/common.h /dovecot/src/auth/db-ldap.h /dovecot/src/auth/db-passwd-file.h /dovecot/src/auth/db-sql.h /dovecot/src/auth/mech.h /dovecot/src/auth/mycrypt.h /dovecot/src/auth/otp-skey-common.h /dovecot/src/auth/passdb-blocking.h /dovecot/src/auth/passdb-cache.h /dovecot/src/auth/passdb.h /dovecot/src/auth/password-scheme.h /dovecot/src/auth/plain-common.h /dovecot/src/auth/userdb-blocking.h /dovecot/src/auth/userdb-static.h /dovecot/src/auth/userdb-vpopmail.h /dovecot/src/auth/userdb.h /dovecot/src/deliver/auth-client.h /dovecot/src/deliver/deliver.h /dovecot/src/deliver/duplicate.h /dovecot/src/deliver/mail-send.h /dovecot/src/deliver/smtp-client.h /dovecot/src/dict/dict-cache.h /dovecot/src/dict/dict-server.h /dovecot/src/imap-login/client-authenticate.h /dovecot/src/imap-login/client.h /dovecot/src/imap-login/imap-proxy.h /dovecot/src/imap/client.h /dovecot/src/imap/commands-util.h /dovecot/src/imap/commands.h /dovecot/src/imap/common.h /dovecot/src/imap/imap-expunge.h /dovecot/src/imap/imap-fetch.h /dovecot/src/imap/imap-messageset.h /dovecot/src/imap/imap-search.h /dovecot/src/imap/imap-sort.h /dovecot/src/imap/imap-status.h /dovecot/src/imap/imap-sync.h /dovecot/src/imap/imap-thread.h /dovecot/src/lib-auth/auth-client.h /dovecot/src/lib-auth/auth-server-connection.h /dovecot/src/lib-auth/auth-server-request.h /dovecot/src/lib-charset/charset-utf8.h /dovecot/src/lib-dict/dict-client.h /dovecot/src/lib-dict/dict-private.h /dovecot/src/lib-dict/dict-sql.h /dovecot/src/lib-dict/dict.h /dovecot/src/lib-imap/imap-base-subject.h /dovecot/src/lib-imap/imap-bodystructure.h /dovecot/src/lib-imap/imap-date.h /dovecot/src/lib-imap/imap-envelope.h /dovecot/src/lib-imap/imap-match.h /dovecot/src/lib-imap/imap-parser.h /dovecot/src/lib-imap/imap-quote.h /dovecot/src/lib-imap/imap-util.h /dovecot/src/lib-index/mail-cache-private.h /dovecot/src/lib-index/mail-cache.h /dovecot/src/lib-index/mail-hash.h /dovecot/src/lib-index/mail-index-private.h /dovecot/src/lib-index/mail-index-sync-private.h /dovecot/src/lib-index/mail-index-transaction-private.h /dovecot/src/lib-index/mail-index-view-private.h /dovecot/src/lib-index/mail-index.h /dovecot/src/lib-index/mail-transaction-log-private.h /dovecot/src/lib-index/mail-transaction-log.h /dovecot/src/lib-index/mailbox-list-index-private.h /dovecot/src/lib-index/mailbox-list-index.h /dovecot/src/lib-mail/istream-header-filter.h /dovecot/src/lib-mail/mail-types.h /dovecot/src/lib-mail/message-address.h /dovecot/src/lib-mail/message-date.h /dovecot/src/lib-mail/message-decoder.h /dovecot/src/lib-mail/message-header-decode.h /dovecot/src/lib-mail/message-header-parser.h /dovecot/src/lib-mail/message-id.h /dovecot/src/lib-mail/message-parser.h /dovecot/src/lib-mail/message-part-serialize.h /dovecot/src/lib-mail/message-search.h /dovecot/src/lib-mail/message-send.h /dovecot/src/lib-mail/message-size.h /dovecot/src/lib-mail/quoted-printable.h /dovecot/src/lib-mail/rfc822-parser.h /dovecot/src/lib-ntlm/ntlm-byteorder.h /dovecot/src/lib-ntlm/ntlm-des.h /dovecot/src/lib-ntlm/ntlm-encrypt.h /dovecot/src/lib-ntlm/ntlm-flags.h /dovecot/src/lib-ntlm/ntlm-message.h /dovecot/src/lib-ntlm/ntlm-types.h /dovecot/src/lib-ntlm/ntlm.h /dovecot/src/lib-otp/otp-dictionary.h /dovecot/src/lib-otp/otp-hash.h /dovecot/src/lib-otp/otp-parity.h /dovecot/src/lib-otp/otp-parse.h /dovecot/src/lib-otp/otp.h /dovecot/src/lib-settings/settings.h /dovecot/src/lib-sql/sql-api-private.h /dovecot/src/lib-sql/sql-api.h /dovecot/src/lib-storage/index/cydir/cydir-storage.h /dovecot/src/lib-storage/index/cydir/cydir-sync.h /dovecot/src/lib-storage/index/dbox/dbox-file.h /dovecot/src/lib-storage/index/dbox/dbox-index.h /dovecot/src/lib-storage/index/dbox/dbox-storage.h /dovecot/src/lib-storage/index/dbox/dbox-sync.h /dovecot/src/lib-storage/index/index-mail.h /dovecot/src/lib-storage/index/index-sort.h /dovecot/src/lib-storage/index/index-storage.h /dovecot/src/lib-storage/index/index-sync-changes.h /dovecot/src/lib-storage/index/maildir/maildir-filename.h /dovecot/src/lib-storage/index/maildir/maildir-keywords.h /dovecot/src/lib-storage/index/maildir/maildir-storage.h /dovecot/src/lib-storage/index/maildir/maildir-sync.h /dovecot/src/lib-storage/index/maildir/maildir-uidlist.h /dovecot/src/lib-storage/index/mbox/istream-raw-mbox.h /dovecot/src/lib-storage/index/mbox/mbox-file.h /dovecot/src/lib-storage/index/mbox/mbox-from.h /dovecot/src/lib-storage/index/mbox/mbox-lock.h /dovecot/src/lib-storage/index/mbox/mbox-md5.h /dovecot/src/lib-storage/index/mbox/mbox-storage.h /dovecot/src/lib-storage/index/mbox/mbox-sync-private.h /dovecot/src/lib-storage/list/index-mailbox-list.h /dovecot/src/lib-storage/list/mailbox-list-fs.h /dovecot/src/lib-storage/list/mailbox-list-maildir.h /dovecot/src/lib-storage/list/mailbox-list-subscriptions.h /dovecot/src/lib-storage/list/subscription-file.h /dovecot/src/lib-storage/mail-copy.h /dovecot/src/lib-storage/mail-error.h /dovecot/src/lib-storage/mail-namespace.h /dovecot/src/lib-storage/mail-search.h /dovecot/src/lib-storage/mail-storage-private.h /dovecot/src/lib-storage/mail-storage.h /dovecot/src/lib-storage/mailbox-list-private.h /dovecot/src/lib-storage/mailbox-list.h /dovecot/src/lib-storage/mailbox-tree.h array-decl.h array.h backtrace-string.h base64.h bsearch-insert-pos.h buffer.h close-keep-errno.h compat.h crc32.h data-stack.h env-util.h failures.h fd-close-on-exec.h fd-set-nonblock.h fdpass.h file-cache.h file-copy.h file-dotlock.h file-lock.h file-set-size.h hash.h hex-binary.h hex-dec.h hmac-md5.h home-expand.h hostpid.h imem.h ioloop-internal.h ioloop-iolist.h ioloop-notify-fd.h ioloop.h iostream-internal.h istream-internal.h istream-seekable.h istream-tee.h istream.h lib-signals.h lib.h macros.h md4.h md5.h mempool.h mkdir-parents.h mmap-util.h module-context.h module-dir.h mountpoint.h network.h nfs-workarounds.h ostream-crlf.h ostream-internal.h ostream.h primes.h printf-format-fix.h process-title.h randgen.h read-full.h restrict-access.h restrict-process-size.h safe-memset.h safe-mkdir.h safe-mkstemp.h sendfile-util.h seq-range-array.h sha1.h str-find.h str-sanitize.h str.h strescape.h strfuncs.h unichar.h unix-socket-create.h unlink-directory.h unlink-lockfiles.h utc-mktime.h utc-offset.h var-expand.h write-full.h /dovecot/src/login-common/client-common.h /dovecot/src/login-common/common.h /dovecot/src/login-common/login-proxy.h /dovecot/src/login-common/master.h /dovecot/src/login-common/sasl-server.h /dovecot/src/login-common/ssl-proxy.h /dovecot/src/master/askpass.h /dovecot/src/master/auth-process.h /dovecot/src/master/capabilities.h /dovecot/src/master/child-process.h /dovecot/src/master/common.h /dovecot/src/master/dict-process.h /dovecot/src/master/dup2-array.h /dovecot/src/master/listener.h /dovecot/src/master/log.h /dovecot/src/master/login-process.h /dovecot/src/master/mail-process.h /dovecot/src/master/master-login-interface.h /dovecot/src/master/master-settings.h /dovecot/src/master/ssl-init.h /dovecot/src/master/syslog-util.h /dovecot/src/plugins/acl/acl-api-private.h /dovecot/src/plugins/acl/acl-api.h /dovecot/src/plugins/acl/acl-backend-vfile.h /dovecot/src/plugins/acl/acl-cache.h /dovecot/src/plugins/acl/acl-plugin.h /dovecot/src/plugins/convert/convert-plugin.h /dovecot/src/plugins/convert/convert-storage.h /dovecot/src/plugins/expire/auth-client.h /dovecot/src/plugins/expire/expire-env.h /dovecot/src/plugins/expire/expire-plugin.h /dovecot/src/plugins/fts-lucene/fts-lucene-plugin.h /dovecot/src/plugins/fts-lucene/lucene-wrapper.h /dovecot/src/plugins/fts-squat/fts-squat-plugin.h /dovecot/src/plugins/fts-squat/squat-trie-private.h /dovecot/src/plugins/fts-squat/squat-trie.h /dovecot/src/plugins/fts-squat/squat-uidlist.h /dovecot/src/plugins/fts/fts-api-private.h /dovecot/src/plugins/fts/fts-api.h /dovecot/src/plugins/fts/fts-plugin.h /dovecot/src/plugins/imap-quota/imap-quota-plugin.h /dovecot/src/plugins/lazy-expunge/lazy-expunge-plugin.h /dovecot/src/plugins/mail-log/mail-log-plugin.h /dovecot/src/plugins/mbox-snarf/mbox-snarf-plugin.h /dovecot/src/plugins/quota/quota-fs.h /dovecot/src/plugins/quota/quota-plugin.h /dovecot/src/plugins/quota/quota-private.h /dovecot/src/plugins/quota/quota.h /dovecot/src/plugins/trash/trash-plugin.h /dovecot/src/plugins/zlib/istream-zlib.h /dovecot/src/plugins/zlib/zlib-plugin.h /dovecot/src/pop3-login/client-authenticate.h /dovecot/src/pop3-login/client.h /dovecot/src/pop3-login/pop3-proxy.h /dovecot/src/pop3/capability.h /dovecot/src/pop3/client.h /dovecot/src/pop3/commands.h /dovecot/src/pop3/common.h
0ddb604f911b908085ef787455c015a91dc9c365 20-Jul-2007 Timo Sirainen <tss@iki.fi>

Added uni_ucs4_to_titlecase() and uni_utf8_to_decomposed_titlecase(). They use a unicharmap.c file generated from UnicodeData.txt. --HG-- branch : HEAD

2a7605bb97dc9ed8accf2537fad1073a5fc5ff48 11-Jun-2007 Timo Sirainen <tss@iki.fi>

Rewrote some code and cleaned up the API --HG-- branch : HEAD

aa883f5fbc68920c48c4f52919e8a5bb9611e678 13-Dec-2006 Timo Sirainen <tss@iki.fi>

Added unichar_t UCS-4 type and some ucs4/utf8 functions. --HG-- branch : HEAD