version 0.3.25
[fms.git] / include / unicode / utfconversion.h
diff --git a/include/unicode/utfconversion.h b/include/unicode/utfconversion.h
new file mode 100644 (file)
index 0000000..2ebe864
--- /dev/null
@@ -0,0 +1,25 @@
+#ifndef _UTF_conversion_\r
+#define _UTF_conversion_\r
+\r
+/*\r
+       Thanks to http://www.codeproject.com/KB/string/UtfConverter.aspx for the basic idea\r
+       http://www.unicode.org/Public/PROGRAMS/CVTUTF/\r
+*/\r
+\r
+#include <string>\r
+#include <vector>\r
+\r
+#include "ConvertUTF.h"\r
+\r
+namespace UTFConversion\r
+{\r
+\r
+// UTF-8 byte sequence to UTF-16 or UTF-32, depending on size of wchar_t\r
+const bool FromUTF8(const std::vector<char> &utf8string, std::wstring &wcstring);\r
+const bool FromUTF8(const std::string &utf8string, std::wstring &wcstring);\r
+// UTF-16 or UTF-32 to UTF-8 byte sequence\r
+const bool ToUTF8(const std::wstring &wcstring, std::string &utf8string);\r
+\r
+}      // namespace\r
+\r
+#endif // _UTF_conversion_\r