stclib / STC

A modern, user friendly, generic, type-safe and fast C99 container library: String, Vector, Sorted and Unordered Map and Set, Deque, Forward List, Smart Pointers, Bitset and Random numbers.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature request: i_no_unicode flag

polijan opened this issue · comments

Feature Request: could there be a i_no_unicode (or equivalent) at cstr inclusion so that it wouldn't define or try to compile utf-8 related functions? Of course, most projects should want utf-8 strings everywhere... but there are also simple tools where it's just not needed.

Hi. By default, there is only a few small utf8 inline function defined/included, i.e the ones in the utf8.h header, which allows you to iterate codepoints in utf8 strings. To get utf8 lowercase/uppercase or case-insensitive comparison functions you must either #define i_import before including one of the string/view headers, cregex or link with src/utf8code.c. cregex always requires linking with the utf8 character tables.

Add: several functions in utf8_hdr.h calls functions from utf8code.c, so program will fail to link if they are called without linking with utf8code.

let's close the issue.