aboutsummaryrefslogtreecommitdiff
path: root/xbmc/filesystem/ZipManager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'xbmc/filesystem/ZipManager.cpp')
-rw-r--r--xbmc/filesystem/ZipManager.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/xbmc/filesystem/ZipManager.cpp b/xbmc/filesystem/ZipManager.cpp
index df6220bf8a..0e0701b770 100644
--- a/xbmc/filesystem/ZipManager.cpp
+++ b/xbmc/filesystem/ZipManager.cpp
@@ -34,6 +34,8 @@
using namespace XFILE;
+static const size_t ZC_FLAG_EFS = 1 << 11; // general purpose bit 11 - zip holds utf-8 filenames
+
CZipManager::CZipManager()
{
}
@@ -192,9 +194,13 @@ bool CZipManager::GetZipList(const CURL& url, std::vector<SZipEntry>& items)
return false;
std::string strName(bufName.get(), bufName.size());
bufName.clear();
- g_charsetConverter.unknownToUTF8(strName);
+ if ((ze.flags & ZC_FLAG_EFS) == 0)
+ {
+ std::string tmp(strName);
+ g_charsetConverter.ToUtf8("CP437", tmp, strName);
+ }
ZeroMemory(ze.name, 255);
- strncpy(ze.name, strName.c_str(), strName.size()>254 ? 254 : strName.size());
+ strncpy(ze.name, strName.c_str(), strName.size() > 254 ? 254 : strName.size());
// Jump after central file header extra field and file comment
mFile.Seek(ze.eclength + ze.clength,SEEK_CUR);