EncodingConverter 1.1.1
dotnet tool install --global EncodingConverter --version 1.1.1
dotnet new tool-manifest
dotnet tool install --local EncodingConverter --version 1.1.1
#tool dotnet:?package=EncodingConverter&version=1.1.1
nuke :add-package EncodingConverter --version 1.1.1
EncodingConverter
🧩 Overview
EncodingConverter is a command-line tool designed to convert text files between different encodings / code pages.
For example, Visual Studio often creates source files using Code Page 1252 (Windows-1252). If you use non-ASCII characters such as ä, ö, or ü, these files typically need to be converted to UTF-8 (Code Page 65001).
Doing this manually for dozens or hundreds of files is tedious — EncodingConverter automates the entire process quickly.
🚀 Installation
The tool is distributed as a NuGet package.
dotnet tool install --global EncodingConverter
Or within a specific project:
dotnet add package EncodingConverter
After installation, the executable EncodingConverter (or EncodingConverter.exe) becomes available.
⚙️ Usage
Basic syntax:
EncodingConverter [options]
Example
EncodingConverter -d "C:\Projects\MyApp" -s "*.h,*.cpp" --OutputCodePage 65001 -r --verbose
This example recursively searches the given directory for .h and .cpp files
and converts them from Code Page 1252 to UTF-8 (65001).
🧾 Command Line Options
| Short / Long | Type | Default | Description |
|---|---|---|---|
-d, --directory |
string |
.\ |
Specifies the directory to search for files. |
-s, --searchpattern |
string |
*.* |
File search pattern(s). Example: "*.h" or "*.h,*.cpp". |
-r, --recursive |
bool |
false |
Enables recursive directory processing. |
--InputCodePage |
int |
1252 |
Input code page used to read the file (e.g. 1252 = Windows-1252). |
--OutputCodePage |
int |
65001 |
Output code page used to write the file (e.g. 65001 = UTF-8). |
--verbose |
bool |
false |
Enables more detailed console messages. |
💡 Notes
- The tool uses NLog for colored console output and structured logging.
- Files are converted in-place — no backup copies are created automatically.
- It is recommended to create a backup before converting production files.
- Multiple file patterns are supported by separating them with commas (
,).
🧨 Exit Codes
| Code | Name | Description |
|---|---|---|
0 |
Ok |
Conversion completed successfully. |
1 |
FoundProblems |
Some files could not be converted successfully. |
2 |
CommandLine |
Invalid or incomplete command-line parameters. |
3 |
InputDirectoryNotFound |
The specified input directory was not found. |
4 |
UnexpectedException |
An unexpected runtime exception occurred. |
🧱 Technical Details
Uses the following libraries:
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
This package has no dependencies.