System.NotSupportedException: Encoding 437 data could not be found (for Xamarin.Mac) #370

Closed
opened 2026-01-29 22:10:48 +00:00 by claunia · 4 comments
Owner

Originally created by @kaustubh1994 on GitHub (Aug 21, 2019).

I am using SharpCompress to open archives in a project targeting Xamarin.Mac (and not Xamarin.Forms). However the following exception is being thrown:

System.NotSupportedException: 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 <01bd5f62a4254f5280d3577f58ee50a6>:0
at SharpCompress.Common.ArchiveEncoding..ctor () [0x00006] in <6f462774e7974946823dce93c5ad53fe>:0
at SharpCompress.Common.OptionsBase..ctor () [0x00007] in <6f462774e7974946823dce93c5ad53fe>:0
at SharpCompress.Readers.ReaderOptions..ctor () [0x00000] in <6f462774e7974946823dce93c5ad53fe>:0
at SharpCompress.Archives.ArchiveFactory.Open (System.IO.Stream stream, SharpCompress.Readers.ReaderOptions readerOptions) [0x0002b] in <6f462774e7974946823dce93c5ad53fe>:0

The compile target for my project is a library which will be used by another application.

I am using VS 2017. The Xamarin.Mac version installed is 4.2.1.28 (which cannot be updated due to external dependencies).

Originally created by @kaustubh1994 on GitHub (Aug 21, 2019). I am using SharpCompress to open archives in a project targeting Xamarin.Mac (and not Xamarin.Forms). However the following exception is being thrown: **System.NotSupportedException: 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 <01bd5f62a4254f5280d3577f58ee50a6>:0 at SharpCompress.Common.ArchiveEncoding..ctor () [0x00006] in <6f462774e7974946823dce93c5ad53fe>:0 at SharpCompress.Common.OptionsBase..ctor () [0x00007] in <6f462774e7974946823dce93c5ad53fe>:0 at SharpCompress.Readers.ReaderOptions..ctor () [0x00000] in <6f462774e7974946823dce93c5ad53fe>:0 at SharpCompress.Archives.ArchiveFactory.Open (System.IO.Stream stream, SharpCompress.Readers.ReaderOptions readerOptions) [0x0002b] in <6f462774e7974946823dce93c5ad53fe>:0** The compile target for my project is a library which will be used by another application. I am using VS 2017. The Xamarin.Mac version installed is 4.2.1.28 (which cannot be updated due to external dependencies).
Author
Owner

@adamhathcock commented on GitHub (Aug 21, 2019):

Did you see this? https://stackoverflow.com/questions/38160192/mono-cannot-load-encoding-437#43532921

@adamhathcock commented on GitHub (Aug 21, 2019): Did you see this? https://stackoverflow.com/questions/38160192/mono-cannot-load-encoding-437#43532921
Author
Owner

@kaustubh1994 commented on GitHub (Aug 21, 2019):

I did try that and it does not seem to work. I added that to the csproj file, however I do not have a GUI for my application. I am generating the library to be consumed by a command line app. I tried adding the I18N.*.dlls to my project manually, and this is the exception which I get now.

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.MissingMethodException: Method 'System.Collections.CaseInsensitiveHashCodeProvider.get_Default' not found.
at I18N.Common.Manager.get_PrimaryManager () [0x00017] in <220d55ccb7ce4ffdbf535c59c8df5d3f>:0
at (wrapper managed-to-native) System.Reflection.MonoMethod.InternalInvoke(System.Reflection.MonoMethod,object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00032] in <4a63c4c14ba6401abfdb607b5d7f9751>:0
--- End of inner exception stack trace ---
at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x0004b] in <4a63c4c14ba6401abfdb607b5d7f9751>:0
at System.RuntimeType.InvokeMember (System.String name, System.Reflection.BindingFlags bindingFlags, System.Reflection.Binder binder, System.Object target, System.Object[] providedArgs, System.Reflection.ParameterModifier[] modifiers, System.Globalization.CultureInfo culture, System.String[] namedParams) [0x00680] in <4a63c4c14ba6401abfdb607b5d7f9751>:0
at System.Text.EncodingHelper.InvokeI18N (System.String name, System.Object[] args) [0x0009a] in <4a63c4c14ba6401abfdb607b5d7f9751>:0
at System.Text.Encoding.GetEncoding (System.Int32 codepage) [0x0020d] in <4a63c4c14ba6401abfdb607b5d7f9751>:0
at SharpCompress.Common.ArchiveEncoding..ctor () [0x00006] in <6f462774e7974946823dce93c5ad53fe>:0
at SharpCompress.Common.OptionsBase..ctor () [0x00007] in <6f462774e7974946823dce93c5ad53fe>:0
at SharpCompress.Readers.ReaderOptions..ctor () [0x00000] in <6f462774e7974946823dce93c5ad53fe>:0
at SharpCompress.Archives.ArchiveFactory.Open (System.IO.Stream stream, SharpCompress.Readers.ReaderOptions readerOptions) [0x0002b] in <6f462774e7974946823dce93c5ad53fe>:0

@kaustubh1994 commented on GitHub (Aug 21, 2019): I did try that and it does not seem to work. I added that to the csproj file, however I do not have a GUI for my application. I am generating the library to be consumed by a command line app. I tried adding the I18N.*.dlls to my project manually, and this is the exception which I get now. **System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.MissingMethodException: Method 'System.Collections.CaseInsensitiveHashCodeProvider.get_Default' not found. at I18N.Common.Manager.get_PrimaryManager () [0x00017] in <220d55ccb7ce4ffdbf535c59c8df5d3f>:0 at (wrapper managed-to-native) System.Reflection.MonoMethod.InternalInvoke(System.Reflection.MonoMethod,object,object[],System.Exception&) at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00032] in <4a63c4c14ba6401abfdb607b5d7f9751>:0 --- End of inner exception stack trace --- at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x0004b] in <4a63c4c14ba6401abfdb607b5d7f9751>:0 at System.RuntimeType.InvokeMember (System.String name, System.Reflection.BindingFlags bindingFlags, System.Reflection.Binder binder, System.Object target, System.Object[] providedArgs, System.Reflection.ParameterModifier[] modifiers, System.Globalization.CultureInfo culture, System.String[] namedParams) [0x00680] in <4a63c4c14ba6401abfdb607b5d7f9751>:0 at System.Text.EncodingHelper.InvokeI18N (System.String name, System.Object[] args) [0x0009a] in <4a63c4c14ba6401abfdb607b5d7f9751>:0 at System.Text.Encoding.GetEncoding (System.Int32 codepage) [0x0020d] in <4a63c4c14ba6401abfdb607b5d7f9751>:0 at SharpCompress.Common.ArchiveEncoding..ctor () [0x00006] in <6f462774e7974946823dce93c5ad53fe>:0 at SharpCompress.Common.OptionsBase..ctor () [0x00007] in <6f462774e7974946823dce93c5ad53fe>:0 at SharpCompress.Readers.ReaderOptions..ctor () [0x00000] in <6f462774e7974946823dce93c5ad53fe>:0 at SharpCompress.Archives.ArchiveFactory.Open (System.IO.Stream stream, SharpCompress.Readers.ReaderOptions readerOptions) [0x0002b] in <6f462774e7974946823dce93c5ad53fe>:0**
Author
Owner

@adamhathcock commented on GitHub (Aug 21, 2019):

You can change the encoding manually. This is a platform issue though. Nothing I can do other than have the ability to override the encoding.

@adamhathcock commented on GitHub (Aug 21, 2019): You can change the encoding manually. This is a platform issue though. Nothing I can do other than have the ability to override the encoding.
Author
Owner

@adamhathcock commented on GitHub (Jul 26, 2020):

New release https://www.nuget.org/packages/sharpcompress/0.26.0 should fix this

@adamhathcock commented on GitHub (Jul 26, 2020): New release https://www.nuget.org/packages/sharpcompress/0.26.0 should fix this
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/sharpcompress#370