]> git.saurik.com Git - wxWidgets.git/commitdiff
unified to use ASCII for ZIP entries and fn_str() when passing archive name to unzip.c
authorVáclav Slavík <vslavik@fastmail.fm>
Sat, 27 Dec 2003 08:52:05 +0000 (08:52 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Sat, 27 Dec 2003 08:52:05 +0000 (08:52 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@25015 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/toback24.txt
src/common/fs_zip.cpp
src/common/zipstrm.cpp

index 2e56e8c7ac37fe9710c49a132235ce838bca1eab..4eabc1f2a43739d9f5b5d65d49a4d0850a4c2ec7 100644 (file)
@@ -221,6 +221,17 @@ Checking in src/msw/regconf.cpp;
 /pack/cvsroots/wxwindows/wxWindows/src/msw/regconf.cpp,v  <--  regconf.cpp
 new revision: 1.48; previous revision: 1.47
 
+31. Cleanup of ZIP charset conversion in Unicode build
+
+Checking in fs_zip.cpp;
+/pack/cvsroots/wxwindows/wxWindows/src/common/fs_zip.cpp,v  <--  fs_zip.cpp
+new revision: 1.27; previous revision: 1.26
+done
+Checking in zipstrm.cpp;
+/pack/cvsroots/wxwindows/wxWindows/src/common/zipstrm.cpp,v  <--  zipstrm.cpp
+new revision: 1.10; previous revision: 1.9
+done
+
 
 TODO for 2.4 (items that are not backports)
 ===========================================
index bb449aab85aaf358a9afbdba6819ba4769eddad6..d322d775477aef6aa89885b347f18bb17f4da764 100644 (file)
@@ -151,7 +151,7 @@ wxString wxZipFSHandler::FindFirst(const wxString& spec, int flags)
 
     m_ZipFile = left;
     wxString nativename = wxFileSystem::URLToFileName(m_ZipFile).GetFullPath();
-    m_Archive = (void*) unzOpen(nativename.mb_str());
+    m_Archive = (void*) unzOpen(nativename.fn_str());
     m_Pattern = right.AfterLast(wxT('/'));
     m_BaseDir = right.BeforeLast(wxT('/'));
 
@@ -196,7 +196,7 @@ wxString wxZipFSHandler::DoFind()
     {
         unzGetCurrentFileInfo((unzFile)m_Archive, NULL, namebuf, 1024, NULL, 0, NULL, 0);
         for (c = namebuf; *c; c++) if (*c == '\\') *c = '/';
-        namestr = wxString::FromAscii( namebuf );    // TODO what encoding does ZIP use?
+        namestr = wxString::FromAscii(namebuf); // TODO what encoding does ZIP use?
 
         if (m_AllowDirs)
         {
index d3053e30ff98b968ee8afaf42678a07e33ecefc4..9401ef1c1a95aa22676dcd85f3c5900fd25318ac 100644 (file)
@@ -40,13 +40,14 @@ wxZipInputStream::wxZipInputStream(const wxString& archive, const wxString& file
 
     m_Pos = 0;
     m_Size = 0;
-    m_Archive = (void*) unzOpen(archive.mb_str());
+    m_Archive = (void*) unzOpen(archive.fn_str());
     if (m_Archive == NULL)
     {
         m_lasterror = wxSTREAM_READ_ERROR;
         return;
     }
-    if (unzLocateFile((unzFile)m_Archive, file.mb_str(), 0) != UNZ_OK)
+    // TODO what encoding does ZIP use?
+    if (unzLocateFile((unzFile)m_Archive, file.ToAscii(), 0) != UNZ_OK)
     {
         m_lasterror = wxSTREAM_READ_ERROR;
         return;