diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2013-01-17 18:47:53 +0100 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2013-01-17 19:49:48 +0100 |
| commit | 9c2bbe218b32d6ce44be976a7b14eb0908a102e0 (patch) | |
| tree | 481f12e5a695863db7f47fb5c39f88eced97dc83 /src/string.hh | |
| parent | 44ca4d23de3508b668736ddad902afdb2a941e38 (diff) | |
replace char: fix unicode handling
Diffstat (limited to 'src/string.hh')
| -rw-r--r-- | src/string.hh | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/string.hh b/src/string.hh index ef30195d..773a6cbc 100644 --- a/src/string.hh +++ b/src/string.hh @@ -101,6 +101,14 @@ inline String operator"" _str(const char* str, size_t) return String(str); } +inline String codepoint_to_str(Codepoint cp) +{ + std::string str; + auto it = back_inserter(str); + utf8::dump(it, cp); + return String(str); +} + } namespace std |
