SharpZipLib: 1 is not a supported code page
Asked Answered
T

1

16

I use SharpZipLib to compress file and user got this error:

1 is not a supported code page

I found here that problem is in regional settings and solution is in

"replace the line of code that fetches the code page from the Thread's OEMCodePage and instead hardcode the suitable value."

But I didn't find any code example to solve this problem.

Tartaglia answered 26/10, 2017 at 9:18 Comment(0)
A
20

Line below hardcodes code page to avoid getting it from system regional settings:

ICSharpCode.SharpZipLib.Zip.ZipConstants.DefaultCodePage = 437;
Affer answered 27/12, 2017 at 19:9 Comment(4)
I think the asker would also benefit from an explanation so they don't repeat the mistake.Jablon
Fixed my bug with the Visual Ribbon Editor for CRM. ThanksLibration
Codepage 850 may be a better choice in some cases. According to the SharpZipLib comments, unicode codepages like 65001 (UTF-8) are not a good idea due to compatability issues.Realpolitik
This is what's so great about stackoverflow, you have a really weird error happening on just one computer and someone already found the solution.Subsequence

© 2022 - 2024 — McMap. All rights reserved.