Create Windows-compatible ZIP files from macOS
Project description
mac2win-zip
Create Windows-compatible ZIP files from macOS
"Where's my files after I zip on Mac and open it in Windows?" Garbled Korean filenames and missing characters? You're not alone. This tool fixes it.
| macOS (ZIP created) | Windows (ZIP opened) |
|---|---|
| 📄 Hello?.pdf | ❌ (removed) |
| 📄 안녕하세요 세상.pdf | ❌ (removed) |
⬇️ Use mac2win-zip ⬇️
| macOS (ZIP created) | Windows (ZIP opened) |
|---|---|
| 📄 Hello.pdf | ✅ Hello.pdf |
| 📄 안녕하세요 세상.pdf | ✅ 안녕하세요 세상.pdf |
With mac2win-zip, your filenames stay intact when opening on Windows! macOS에서 생성한 ZIP 파일을 Windows에서 열어도 파일명이 깨지지 않습니다.
Why mac2win-zip?
The Problem
macOS uses NFD (Normalization Form Decomposed) for Unicode filenames, while Windows uses NFC (Normalization Form Composed). When you create a ZIP file on macOS containing files with Unicode characters (like Korean, Japanese, or special characters), Windows users often see garbled filenames.
Additionally, macOS allows certain characters in filenames (like : or |) that are forbidden on Windows.
The Solution
mac2win-zip automatically:
- Normalizes all filenames from NFD to NFC
- Removes or replaces Windows-forbidden characters
- Excludes macOS-specific files (
.DS_Store, etc.) - Preserves the folder structure
Result: ZIP files that work perfectly on both macOS and Windows!
Installation
# Clone the repository
git clone https://github.com/Wordbe/mac2win-zip.git
cd mac2win-zip
# Install globally
uv tool install .
Now you can use mac2win-zip from anywhere!
Quick Start
# Zip current directory (creates current-folder-name.zip)
mac2win-zip
# Zip a specific folder (creates my-folder.zip)
mac2win-zip my-folder
# Zip multiple files (creates archive.zip by default)
mac2win-zip file1.pdf file2.jpg
# Custom output name with -o option
mac2win-zip my-folder -o backup.zip
Usage Examples
Basic Usage
# Zip everything in current directory (creates folder-name.zip)
mac2win-zip
# Zip a folder (automatically includes all subdirectories, creates folder1.zip)
mac2win-zip folder1
# Zip specific files (creates archive.zip)
mac2win-zip report.pdf presentation.pptx
Advanced Usage
# Custom output name with -o option
mac2win-zip folder1 -o backup.zip
# Zip multiple folders and files together
mac2win-zip folder1 folder2 notes.txt -o backup-2024.zip
# Custom output location
mac2win-zip ~/Downloads -o ~/Desktop/downloads-backup.zip
Help
mac2win-zip --help
Features
- Unicode Normalization: Converts macOS NFD filenames to Windows-compatible NFC
- Character Sanitization: Removes Windows-forbidden characters (
<>:"|?*\) - Auto Recursive: Automatically includes all subdirectories when zipping folders
- Smart Naming: Creates
folder-name.zipby default (no -o needed for single folder) - Structure Preservation: Maintains original folder hierarchy in ZIP
- Smart Filtering: Excludes hidden files (
.DS_Store, etc.) - Korean Support: Perfect handling of Korean and other Unicode filenames
- Simple CLI: Intuitive command-line interface
License
This project is licensed under the MIT License - see the LICENSE file for details.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Bug Reports
If you discover any bugs, please create an issue on GitHub with:
- Your operating system and version
- Python version
- Steps to reproduce the bug
- Expected vs actual behavior
Show Your Support
If this project helped you, please give it a star!
How It Works
Installation Process
When you run uv tool install ., here's what happens:
- Creates isolated environment: uv creates a dedicated virtual environment at
~/.local/share/uv/tools/mac2win-zip/ - Installs dependencies: All required packages (pytest, black, ruff, etc.) are installed in this isolated environment
- Creates executable: A wrapper script is generated that calls your Python code
- Symlinks to PATH: A symbolic link is created at
~/.local/bin/mac2win-zippointing to the executable - Ready to use: Since
~/.local/binis in your PATH, you can now runmac2win-zipfrom anywhere
File Locations
~/.local/share/uv/tools/mac2win-zip/ # Isolated environment with all dependencies
~/.local/bin/mac2win-zip # Executable symlink (in your PATH)
The Wrapper Script
The generated executable at ~/.local/bin/mac2win-zip is a simple Python script:
#!/path/to/python
import sys
from mac2win_zip.cli import main
sys.exit(main())
This is defined in pyproject.toml:
[project.scripts]
mac2win-zip = "mac2win_zip.cli:main"
Benefits
- Isolation: Each tool has its own environment, no conflicts with other Python packages
- System-wide access: Works from any directory
- Clean uninstall: Easy to remove without leaving traces
Uninstall
To remove the tool completely:
uv tool uninstall mac2win-zip
This removes both the isolated environment and the executable symlink.
Made with ❤️ by Wordbe for seamless macOS-Windows file sharing
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mac2win_zip-1.0.1.tar.gz.
File metadata
- Download URL: mac2win_zip-1.0.1.tar.gz
- Upload date:
- Size: 62.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e95483b09826666e33c74990fda5e7e6a7b53427b49f150cdef4760479a3b358
|
|
| MD5 |
d2c943b3f36a06f0c5117600a36558bd
|
|
| BLAKE2b-256 |
f3b67c16ace1ebf9856cb9b31588a60e95e8d244648114832706832bf00834d5
|
File details
Details for the file mac2win_zip-1.0.1-py3-none-any.whl.
File metadata
- Download URL: mac2win_zip-1.0.1-py3-none-any.whl
- Upload date:
- Size: 8.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
54824e451149bf530f8978f7a74db499b5a55f913b33d8efc59e75af6e15e3b5
|
|
| MD5 |
3b21916d2f49fe9c018860adc04b9f41
|
|
| BLAKE2b-256 |
f3f65fa25811bb47735240b23b0b2277ef25b545b1568bfc07349ce903312660
|