Add basic UTF-8 helper functions
Add utf8_width() and utf8_strwidth() which can be used to calculate the display width of a single character or a string, respectively. A lookup table is used to spot double width characters, as well as composing characters. There currently isn't any code to deal with ambigious characters. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
This commit is contained in:
@@ -832,6 +832,10 @@ void todo_view_note (char *);
|
||||
void todo_init_list (void);
|
||||
void todo_free_list (void);
|
||||
|
||||
/* utf8.c */
|
||||
int utf8_width (char *);
|
||||
int utf8_strwidth (char *);
|
||||
|
||||
/* utils.c */
|
||||
void exit_calcurse (int) __attribute__((__noreturn__));
|
||||
void free_user_data (void);
|
||||
|
||||
Reference in New Issue
Block a user