- Home /
Encoding 437 data could not be found while unzipping in Android 10
While trying to unzip an archive with ICSharpCode.SharpZipLib.Zip.ZipFile in Android 10. This code:
using (zf = new ZipFile(fsInput)){ .... }
give me the error:
Encoding 437 data could not be found. Make sure you have correct international codeset assembly installed and enabled.
at System.Text.Encoding.GetEncoding (System.Int32 codepage) [0x0023f] in :0 at ICSharpCode.SharpZipLib.Zip.ZipConstants.ConvertToString (System.Byte[] data, System.Int32 count) [0x0000e] in :0 at ICSharpCode.SharpZipLib.Zip.ZipConstants.ConvertToStringExt (System.Int32 flags, System.Byte[] data, System.Int32 count) [0x00020] in :0 at ICSharpCode.SharpZipLib.Zip.ZipFile.ReadEntries () [0x002b2] in :0 at ICSharpCode.SharpZipLib.Zip.ZipFile..ctor (System.IO.Stream stream) [0x00076] in :0 at FileHelper.ExtractZipFile (System.String archiveFilenameIn, System.String password, System.String outFolder) [0x0000b] in ....
I tried to copy all I18N.*.dll from Editor's dll folder to plugins folder. But the error is still there. Any help is welcome. Fabio
Answer by mertkura · Aug 26, 2020 at 09:13 AM
Hello from months later,
I had same issue while using NPOI. Just managed to overcome this problem.
TLDR: Modify "ZipConstants.DefaultCodePage" value in SharpZipLib to UTF8 or encoding related to your setup. (Before using NPOI/SharpZipLib)
ICSharpCode.SharpZipLib.Zip.ZipConstants.DefaultCodePage = System.Text.Encoding.UTF8.CodePage;
I had no problem when i use .xlsx write operations on Unity Editor. However, testing project on build was giving same error with 857 encoding code (turkish-utf8 iso format). I looked up source code of sharpziplib and github issues of sharpziplib, i found this issue and problem was related to ZipConstants takes ZipConstants:15 -> private static int defaultCodePage = Thread.CurrentThread.CurrentCulture.TextInfo.OEMCodePage;
(OEMPage info) which gives unexpected errors on default usage. In Xamarin forum, many people pointed this problem as non-sharplibzip problems but encoding errors and their solution was setting project encoding to utf-8. In Unity, we cannot do that. So, forcing ZipConstants.defaultCodePage or using custom code page for write-read operations solves the problem.
Hi, can you please explain more ? or any example?
I am getting the same error while saving the file.
and interesting is in another module work fine. with the same code !!!
Answer by rmsuhail · May 09, 2020 at 07:14 AM
Were you able to sort it , i'm having the same issue and if you did please update
Your answer
Follow this Question
Related Questions
Android Build Gives Encoding 437 Error When Interacting With ZIP Files 1 Answer
Unity3d zip library to use on android/iOS/web/windows 1 Answer
Unity Android OpenGL GLSurfaceView Access 0 Answers
What extracting libary for rar files will run on Android? 0 Answers
Failed to compress IL2CPP symbol files in android build 0 Answers