unbom 3.3.1
dotnet tool install --global unbom --version 3.3.1
dotnet new tool-manifest # if you are setting up this repo dotnet tool install --local unbom --version 3.3.1
#tool dotnet:?package=unbom&version=3.3.1
nuke :add-package unbom --version 3.3.1
unbom
Tool to remove UTF-8 BOM markers from files.
why
UTF-8 BOMs are problematic and useless in common cases. A lot of tools don't support BOM markers; command-line diff tools for instance. Tools that support UTF-8, support it without markers anyway. They serve no purpose other than making our diff outputs annoying.
Visual Studio defaults to UTF-8+BOM causing the problems.
There are many shell scripts available for removing BOM markers. Many of them either slow or buggy. They assume BOM marker can appear inside a file. A careless user can easily corrupt their files. I just wanted a simple and safer tool so I spent an hour on this.
install
Install unbom by running the command:
dotnet tool install --global unbom
usage
Usage: unbom [options] <filespec>
Options:
-r, --recurse recurse subdirectories
-n, --nobackup do not save a backup file
example
unbom -r *.cs
Remove UTF-8 BOM markers from all files with ".cs" extensions and subdirectories. Saves old versions of files in "filename.bak" file.
license
MIT License. See LICENSE! file for details.
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. |
This package has no dependencies.
Add README entry to the package