tsolomko / SWCompression

A Swift framework for working with compression, archives and containers.
MIT License
238 stars 41 forks source link

Support CP437 on Windows #22

Closed trametheka closed 3 years ago

trametheka commented 3 years ago

Simple patch to add CP437 support on Windows now that Swift 5.4 has official SPM support and CoreFoundation won't be shipped with Windows releases by the looks of it. This is the only change required to compile this library on Windows.

Thanks for this excellent library!

Side Note:

There's already bug reports in for issues with the compiler in Swift 5.4, but it seems to have an issue with the 7-Zip module. I dug into it but I have no idea why, I've simply commented out 7-Zip in the sources in the package for my own use in the mean time (but not in this patch of course).

tsolomko commented 3 years ago

Thank you for your patch. I've merged it and it will be released as part of 4.5.10 some time soon.

I think this issue may be related to this topic on Swift forums. You may notice that I responded to it mentioning that I use CP437 from CoreFoundation, but at the time I wasn't concerned about it, since empirically it didn't affect Darwin or Linux platforms. I also don't know if there was any further development about "removing CoreFoundation", but probably in the future I will have to reconsider how I am dealing with CP437 encoding.

Side Note:

There's already bug reports in for issues with the compiler in Swift 5.4, but it seems to have an issue with the 7-Zip module. I dug into it but I have no idea why, I've simply commented out 7-Zip in the sources in the package for my own use in the mean time (but not in this patch of course).

Yeah, I am aware of the issues with Swift 5.4 compiler. I even made one of the bug reports of my own: https://bugs.swift.org/browse/SR-14594.

It seems, though, that these issues are present only on Linux (and maybe on Windows?), and I also have no idea what is actually the problem. Hopefully, they will fix these issues soon in Swift compiler.