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:
Lukas Fleischer
2011-05-31 20:04:03 +02:00
parent 7f5fc0c62f
commit 271457b7a4
3 changed files with 338 additions and 0 deletions

View File

@@ -22,6 +22,7 @@ calcurse_SOURCES = \
recur.c \
sigs.c \
todo.c \
utf8.c \
utils.c \
vars.c \
wins.c \