Add support for UTF8 filenames in wxZipOutputStream
Zip filenames containing non ASCII characters will be marked with bit 11 in the general purpose flags and will use UTF-8 encoding. By only setting the flag when non ASCII characters are used the created archives should be binary identical to previous versions. The old behavior can be achieved by explicitly using wxConvLocal with the constructor. This should also ensure that existing code using a custom wxMBConv should work as before.
This commit is contained in:
@@ -236,6 +236,8 @@ private:
|
||||
|
||||
bool LoadExtraInfo(const char* extraData, wxUint16 extraLen, bool localInfo);
|
||||
|
||||
wxUint16 GetInternalFlags(bool checkForUTF8) const;
|
||||
|
||||
wxUint8 m_SystemMadeBy; // one of enum wxZipSystem
|
||||
wxUint8 m_VersionMadeBy; // major * 10 + minor
|
||||
|
||||
@@ -278,10 +280,10 @@ class WXDLLIMPEXP_BASE wxZipOutputStream : public wxArchiveOutputStream
|
||||
public:
|
||||
wxZipOutputStream(wxOutputStream& stream,
|
||||
int level = -1,
|
||||
wxMBConv& conv = wxConvLocal);
|
||||
wxMBConv& conv = wxConvUTF8);
|
||||
wxZipOutputStream(wxOutputStream *stream,
|
||||
int level = -1,
|
||||
wxMBConv& conv = wxConvLocal);
|
||||
wxMBConv& conv = wxConvUTF8);
|
||||
virtual WXZIPFIX ~wxZipOutputStream();
|
||||
|
||||
bool PutNextEntry(wxZipEntry *entry) { return DoCreate(entry); }
|
||||
|
Reference in New Issue
Block a user