diff options
author | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2009-05-25 18:42:24 +0200 |
---|---|---|
committer | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2009-05-25 18:42:24 +0200 |
commit | 50260728b2e2d2c9e61a13b54b6b973bdc48fae0 (patch) | |
tree | 63b462a3d4cbbf445665714812331b2f7e968204 /src/utf8.cc | |
parent | 6d62e8cf2ed9fe4eda942a59ba140b151b82b228 (diff) |
make tab expansion for plain text utf8 aware
In discussion with corvid <corvid@lavabit.com>.
Diffstat (limited to 'src/utf8.cc')
-rw-r--r-- | src/utf8.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/utf8.cc b/src/utf8.cc index 261024fb..42f7e676 100644 --- a/src/utf8.cc +++ b/src/utf8.cc @@ -36,6 +36,16 @@ uint_t a_Utf8_end_of_char(const char *str, uint_t i) } /* + * Decode a single UTF-8-encoded character starting at p. + * The resulting Unicode value (in the range 0-0x10ffff) is returned, + * and len is set the the number of bytes in the UTF-8 encoding. + */ +uint_t a_Utf8_decode(const char* str, const char* end, int* len) +{ + return utf8decode(str, end, len); +} + +/* * Write UTF-8 encoding of ucs into buf and return number of bytes written. */ int a_Utf8_encode(unsigned int ucs, char *buf) |