diff options
author | 2008-03-11 13:10:25 +0000 | |
---|---|---|
committer | 2008-03-11 13:10:25 +0000 | |
commit | 4ec51432ee14a03b31e046f91f3f6843a8738a6d (patch) | |
tree | f5f6120f5b55f1eb3210cb64a2037a91bba71df3 /src/utils.cpp | |
parent | 54a00c4f5b312c1727156cfacfe2d477507b4ed1 (diff) | |
download | newsboat-4ec51432ee14a03b31e046f91f3f6843a8738a6d.tar.gz newsboat-4ec51432ee14a03b31e046f91f3f6843a8738a6d.tar.zst newsboat-4ec51432ee14a03b31e046f91f3f6843a8738a6d.zip |
Andreas Krennmair:
fixed issue related to string conversion.
Diffstat (limited to '')
-rw-r--r-- | src/utils.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/utils.cpp b/src/utils.cpp index 8ca5cdb5..c7c86dbc 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -17,6 +17,8 @@ #include <curl/curl.h> +#include <stfl.h> + namespace newsbeuter { std::vector<std::string> utils::tokenize_quoted(const std::string& str, std::string delimiters) { @@ -490,6 +492,13 @@ std::string utils::replace_all(std::string str, const std::string& from, const s return str; } +std::wstring utils::utf8str2wstr(const std::string& utf8str) { + stfl_ipool * pool = stfl_ipool_create("utf-8"); + std::wstring wstr(stfl_ipool_towc(pool, utf8str.c_str())); + stfl_ipool_destroy(pool); + return wstr; +} + std::wstring utils::str2wstr(const std::string& str) { const char* pszExt = str.c_str(); wchar_t pwszInt [str.length()+1]; |