unbom 3.3.1

dotnet tool install --global unbom --version 3.3.1                
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest # if you are setting up this repo
dotnet tool install --local unbom --version 3.3.1                
This package contains a .NET tool you can call from the shell/command line.
#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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last updated
3.3.1 24 1/28/2025
3.3.0 31 1/28/2025
3.2.0 1,130 3/16/2023
3.1.0 432 11/11/2022
3.0.0 722 12/18/2020

Add README entry to the package