A CLI tool to convert files (.cpp, .h, etc.) to UTF-8 encoding.
Project description
utf8convert
A command-line utility to recursively convert source files to UTF-8 encoding.
Supports:
.cpp,.h,.hppfiles by default- Any custom extensions via
--extensions - Logging and summary reports (JSON and terminal)
- Dry-run mode
- Default and user-defined subdirectory exclusions
📦 GitHub
Project repository: https://github.com/yhbyhb/utf8convert
🚀 Installation
You can install the package locally after downloading or cloning the repo:
pip install .
This will install the executable command: utf8convert
💻 Usage
utf8convert [DIRECTORY] [OPTIONS]
Options:
-
--dry-run
Preview files to convert without making changes. -
--extensions [.ext1 .ext2 ...]
List of file extensions to process (default:.cpp .h .hpp). -
--exclude-dirs [dir1 dir2 ...]
Relative paths of subdirectories to skip.
Defaults:.git,.vs,vcpkg_installed, and any dot-prefixed folders. -
--json-output PATH
Write a summary report as JSON to the specified path.
📌 Examples
🔍 Dry-run all C++ headers and sources
utf8convert ./src --dry-run
🛠 Convert files with .c and .cc extensions too
utf8convert ./src --extensions .cpp .h .hpp .c .cc
🧾 Generate a JSON report
utf8convert ./mycode --json-output utf8_summary.json
🚫 Skip specific folders
utf8convert ./codebase --exclude-dirs build third_party .cache
🧪 Test Locally
hatch run python -m utf8convert.cli ./your/code --dry-run
Let me know if you want to contribute or need help automating PyPI publishing.
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 utf8convert-0.1.2.tar.gz.
File metadata
- Download URL: utf8convert-0.1.2.tar.gz
- Upload date:
- Size: 5.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ce9eed4ffc6c8a35f042e7c35ea9b1c884d380fd8bd720bc09c2ab2ad8b56027
|
|
| MD5 |
8300b8444a1dac7dd50fc02e587a1738
|
|
| BLAKE2b-256 |
0a55a4bfde73d066afca479b90993ab941d1de82d775bb2904dabddc77ba6016
|
File details
Details for the file utf8convert-0.1.2-py3-none-any.whl.
File metadata
- Download URL: utf8convert-0.1.2-py3-none-any.whl
- Upload date:
- Size: 4.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a6b97cfdc8673f07ae203537ff83b68148f530407d0af14a31ae6fb3d9021e35
|
|
| MD5 |
01bb44bb159b4c8e0040bf1a81438b43
|
|
| BLAKE2b-256 |
7ba51edcfc70f9b2e85eafb99ea3902cd5d1de4389a6a7a7c53c72b5669a5e40
|