aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin van Beurden <chadoe@xbmc.org>2011-12-03 19:19:46 +0100
committerMartin van Beurden <chadoe@xbmc.org>2011-12-03 19:22:30 +0100
commit687465e4f4b995868e1692027e58608649cdcefb (patch)
tree8b4d5574fee9c8ecc12700bc94036f9dc78536e3
parent3f0c57d9d37f97c8571acd68ef4ca40bb6393f83 (diff)
[WIN32] fixed: give python system encoded strings instead of xbmc-gui encoded.
-rw-r--r--xbmc/interfaces/python/XBPyThread.cpp5
-rw-r--r--xbmc/utils/CharsetConverter.cpp7
-rw-r--r--xbmc/utils/CharsetConverter.h1
3 files changed, 11 insertions, 2 deletions
diff --git a/xbmc/interfaces/python/XBPyThread.cpp b/xbmc/interfaces/python/XBPyThread.cpp
index 58e61396b8..efec248ffd 100644
--- a/xbmc/interfaces/python/XBPyThread.cpp
+++ b/xbmc/interfaces/python/XBPyThread.cpp
@@ -92,7 +92,7 @@ void XBPyThread::setSource(const CStdString &src)
{
#ifdef TARGET_WINDOWS
CStdString strsrc = src;
- g_charsetConverter.utf8ToStringCharset(strsrc);
+ g_charsetConverter.utf8ToSystem(strsrc);
m_source = new char[strsrc.GetLength()+1];
strcpy(m_source, strsrc);
#else
@@ -165,7 +165,8 @@ void XBPyThread::Process()
#ifdef TARGET_WINDOWS
{
CStdString strTmp(_P(addons[i]->LibPath()));
- g_charsetConverter.utf8ToStringCharset(strTmp);
+ CStdString strDest;
+ g_charsetConverter.utf8ToSystem(strTmp);
path += PY_PATH_SEP + strTmp;
}
#else
diff --git a/xbmc/utils/CharsetConverter.cpp b/xbmc/utils/CharsetConverter.cpp
index 243cacaa8f..16a0ace9fb 100644
--- a/xbmc/utils/CharsetConverter.cpp
+++ b/xbmc/utils/CharsetConverter.cpp
@@ -599,6 +599,13 @@ void CCharsetConverter::utf32ToStringCharset(const unsigned long* strSource, CSt
}
}
+void CCharsetConverter::utf8ToSystem(CStdStringA& strSourceDest)
+{
+ CStdString strDest;
+ g_charsetConverter.utf8To("", strSourceDest, strDest);
+ strSourceDest = strDest;
+}
+
// Taken from RFC2640
bool CCharsetConverter::isValidUtf8(const char *buf, unsigned int len)
{
diff --git a/xbmc/utils/CharsetConverter.h b/xbmc/utils/CharsetConverter.h
index da34b2240e..fc68b1bd7c 100644
--- a/xbmc/utils/CharsetConverter.h
+++ b/xbmc/utils/CharsetConverter.h
@@ -46,6 +46,7 @@ public:
void utf8ToStringCharset(const CStdStringA& strSource, CStdStringA& strDest);
void utf8ToStringCharset(CStdStringA& strSourceDest);
+ void utf8ToSystem(CStdStringA& strSourceDest);
void utf8To(const CStdStringA& strDestCharset, const CStdStringA& strSource, CStdStringA& strDest);
void utf8To(const CStdStringA& strDestCharset, const CStdStringA& strSource, CStdString16& strDest);