public asciify
This commit is contained in:
14
lib11sht.h
14
lib11sht.h
@@ -92,4 +92,18 @@ int fequal(float a, float b, float delta);
|
||||
* be NUL-terminated. */
|
||||
void trim(char *s);
|
||||
|
||||
/* Transliterate accented Latin chars to plain ASCII. Walks src as UTF-8,
|
||||
* mapping known accented chars (a-acute, c-cedilla, n-tilde, NBSP, ...)
|
||||
* to their ASCII equivalents and copying ASCII bytes verbatim. Output is
|
||||
* always pure ASCII and NUL-terminated. Bytes that don't match the
|
||||
* transliteration table are skipped.
|
||||
*
|
||||
* Parameters:
|
||||
* src input UTF-8 string (NUL-terminated)
|
||||
* dest output buffer (filled with NUL-terminated ASCII)
|
||||
* dest_size size of dest in bytes (writes capped at dest_size-1 + final NUL)
|
||||
*
|
||||
* Safe for NULL / zero-size args (no-op). */
|
||||
void asciify(const char *src, char *dest, size_t dest_size);
|
||||
|
||||
#endif /* LIB11SHT_H */
|
||||
|
||||
Reference in New Issue
Block a user