kicad: URI-encode zip names to handle unicode

Workaround for wx not handling unicode strings in the archive file
system handler.

Fixes: lp:1812516
* https://bugs.launchpad.net/kicad/+bug/1812516
This commit is contained in:
Seth Hillbrand 2019-01-20 16:40:30 -08:00
parent b13efdb0f2
commit 3a1e66dba3
1 changed files with 4 additions and 2 deletions

View File

@ -29,6 +29,7 @@
#include <wx/dir.h>
#include <wx/fs_zip.h>
#include <wx/uri.h>
#include <wx/wfstream.h>
#include <wx/zipstrm.h>
@ -83,10 +84,11 @@ void KICAD_MANAGER_FRAME::OnUnarchiveFiles( wxCommandEvent& event )
wxFileSystem zipfilesys;
zipfilesys.AddHandler( new wxZipFSHandler );
zipfilesys.ChangePathTo( zipfiledlg.GetPath() + wxT( "#zip:" ), true );
auto path = wxURI( zipfiledlg.GetPath() + wxT( "#zip:" ) ).BuildURI();
zipfilesys.ChangePathTo( path, true );
wxFSFile* zipfile = NULL;
wxString localfilename = zipfilesys.FindFirst( wxFileSelectorDefaultWildcardStr );
wxString localfilename = zipfilesys.FindFirst( wxFileSelectorDefaultWildcardStr, wxFILE );
while( !localfilename.IsEmpty() )
{