Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | utf8_width() performance improvements | Lukas Fleischer | 2011-07-02 | 1 | -39/+50 |
| | | | | | | | | | * Sort character width lookup table by character ranges. * Use binary search instead of linear search for UTF-8 character width lookups which will speed up utf8_width() (O(log n) instead of O(n)). Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de> | ||||
* | Add basic UTF-8 helper functions | Lukas Fleischer | 2011-06-29 | 1 | -0/+333 |
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> |