summaryrefslogtreecommitdiff
path: root/src/utils.cpp
diff options
context:
space:
mode:
authorGravatar Andreas Krennmair <ak@synflood.at> 2008-03-11 13:10:25 +0000
committerGravatar Andreas Krennmair <ak@synflood.at> 2008-03-11 13:10:25 +0000
commit4ec51432ee14a03b31e046f91f3f6843a8738a6d (patch)
treef5f6120f5b55f1eb3210cb64a2037a91bba71df3 /src/utils.cpp
parent54a00c4f5b312c1727156cfacfe2d477507b4ed1 (diff)
downloadnewsboat-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.cpp9
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];