charset,*: Refactor transstr()

This commit is contained in:
ZyX
2018-04-08 16:01:19 +03:00
parent e670756676
commit 0d7daaad98
9 changed files with 204 additions and 144 deletions

View File

@@ -19,6 +19,13 @@
#define MB_BYTE2LEN(b) utf8len_tab[b]
#define MB_BYTE2LEN_CHECK(b) (((b) < 0 || (b) > 255) ? 1 : utf8len_tab[b])
/// Maximum value for 'maxcombine'
///
/// At most that number of composing characters may be attached to the leading
/// character by various `utfc_*` functions. Note that some functions do not
/// have this limit.
enum { MAX_MCO = 6 };
// max length of an unicode char
#define MB_MAXCHAR 6