开发者

How to get Host OS (operating system) parameter of ZIP archive in C#

开发者 https://www.devze.com 2022-12-28 11:40 出处:网络
Look. I have ZIP archives prepared in different os\'es: mac, linux, windows. In windows file names encoded in DOS CP866, mac & linux in UTF-8. I need to know (in code) in which os zip file was pre

Look. I have ZIP archives prepared in different os'es: mac, linux, windows. In windows file names encoded in DOS CP866, mac & linux in UTF-8. I need to know (in code) in which os zip file was prepared to decode file names correctly. There is a Host OS paramterer in "Central directory structure" of zip file (look http://www.fileformat.info/for开发者_JAVA百科mat/zip/corion.htm ). How to get 0005h 1 byte Host OS parameter in C#?


Can you use a StreamReader to get this particular position in the file? I believe you can tell it what offset and length you'd like to read, and it will fetch that set of bytes of you, which will tell you the OS.

0

精彩评论

暂无评论...
验证码 换一张
取 消