summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib/util/unicode.cpp
diff options
context:
space:
mode:
author Nathan Woods <npwoods@mess.org>2016-07-02 12:55:06 -0400
committer Nathan Woods <npwoods@mess.org>2016-07-02 14:23:54 -0400
commitd67695e724bdb7225c6701371545d4fbc16078ef (patch)
tree9fc5cc9df0bf7314fdb28cfea7bdec7126045ed6 /src/lib/util/unicode.cpp
parent60c81498b0b777053268511e1723d5e0a8dd90ae (diff)
Converted menu_file_create to use std::string for its filename buffer
Diffstat (limited to 'src/lib/util/unicode.cpp')
-rw-r--r--src/lib/util/unicode.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/lib/util/unicode.cpp b/src/lib/util/unicode.cpp
index 5975a6872fd..0390576ae9a 100644
--- a/src/lib/util/unicode.cpp
+++ b/src/lib/util/unicode.cpp
@@ -247,6 +247,19 @@ int utf8_from_uchar(char *utf8string, size_t count, unicode_char uchar)
//-------------------------------------------------
+// utf8_from_uchar - convert a unicode character
+// into a UTF-8 sequence
+//-------------------------------------------------
+
+std::string utf8_from_uchar(unicode_char uchar)
+{
+ char buffer[UTF8_CHAR_MAX];
+ auto len = utf8_from_uchar(buffer, ARRAY_LENGTH(buffer), uchar);
+ return std::string(buffer, len);
+}
+
+
+//-------------------------------------------------
// utf16_from_uchar - convert a unicode character
// into a UTF-16 sequence
//-------------------------------------------------