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:
parent
b13efdb0f2
commit
3a1e66dba3
|
@ -29,6 +29,7 @@
|
||||||
|
|
||||||
#include <wx/dir.h>
|
#include <wx/dir.h>
|
||||||
#include <wx/fs_zip.h>
|
#include <wx/fs_zip.h>
|
||||||
|
#include <wx/uri.h>
|
||||||
#include <wx/wfstream.h>
|
#include <wx/wfstream.h>
|
||||||
#include <wx/zipstrm.h>
|
#include <wx/zipstrm.h>
|
||||||
|
|
||||||
|
@ -83,10 +84,11 @@ void KICAD_MANAGER_FRAME::OnUnarchiveFiles( wxCommandEvent& event )
|
||||||
wxFileSystem zipfilesys;
|
wxFileSystem zipfilesys;
|
||||||
|
|
||||||
zipfilesys.AddHandler( new wxZipFSHandler );
|
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;
|
wxFSFile* zipfile = NULL;
|
||||||
wxString localfilename = zipfilesys.FindFirst( wxFileSelectorDefaultWildcardStr );
|
wxString localfilename = zipfilesys.FindFirst( wxFileSelectorDefaultWildcardStr, wxFILE );
|
||||||
|
|
||||||
while( !localfilename.IsEmpty() )
|
while( !localfilename.IsEmpty() )
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue