X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;ds=sidebyside;f=include%2Funicode%2Futfconversion.h;fp=include%2Funicode%2Futfconversion.h;h=2ebe864dcaf7b10c48ceadbc5f86f0dc2b26b8a3;hb=56f67ecca96efc7b72d03c95c8c42cfb66e31468;hp=0000000000000000000000000000000000000000;hpb=f2545574af789b63fc655decfe31a3d9f1b30504;p=fms.git diff --git a/include/unicode/utfconversion.h b/include/unicode/utfconversion.h new file mode 100644 index 0000000..2ebe864 --- /dev/null +++ b/include/unicode/utfconversion.h @@ -0,0 +1,25 @@ +#ifndef _UTF_conversion_ +#define _UTF_conversion_ + +/* + Thanks to http://www.codeproject.com/KB/string/UtfConverter.aspx for the basic idea + http://www.unicode.org/Public/PROGRAMS/CVTUTF/ +*/ + +#include +#include + +#include "ConvertUTF.h" + +namespace UTFConversion +{ + +// UTF-8 byte sequence to UTF-16 or UTF-32, depending on size of wchar_t +const bool FromUTF8(const std::vector &utf8string, std::wstring &wcstring); +const bool FromUTF8(const std::string &utf8string, std::wstring &wcstring); +// UTF-16 or UTF-32 to UTF-8 byte sequence +const bool ToUTF8(const std::wstring &wcstring, std::string &utf8string); + +} // namespace + +#endif // _UTF_conversion_