Skip to content

A space appears at the beginning of the file (Byte order mark) #1922

@v-timofeev

Description

@v-timofeev

Describe the bug you encountered:

If you use bat on C# source files (.cs, .xaml and others), a space appears in the first line. This is due to byte order mark (BOM)
Maybe reproduced for others files on Windows systems
https://en.wikipedia.org/wiki/Byte_order_mark#Byte_order_marks_by_encoding
Sample file with BOM:
Program.cs.txt

IWpnW3OyGgg

Screenshot_57

What did you expect to happen instead?
If I delete these bytes:
Screenshot_58

bat works correctly :

Screenshot_59

How did you install bat?

GitHub release:
bat-v0.18.3-x86_64-pc-windows-gnu.zip
bat-v0.18.3-x86_64-pc-windows-msvc.zip


bat version and environment

Software version

bat 0.18.3 (b146958)

Operating system

Windows 6.2.9200

Command-line

C:\WINDOWS\system32\bat.exe --diagnostic

Environment variables

SHELL=<not set>
PAGER=<not set>
LESS=<not set>
BAT_PAGER=<not set>
BAT_CACHE_PATH=<not set>
BAT_CONFIG_PATH=<not set>
BAT_OPTS=<not set>
BAT_STYLE=<not set>
BAT_TABS=<not set>
BAT_THEME=<not set>
XDG_CONFIG_HOME=<not set>
XDG_CACHE_HOME=<not set>
COLORTERM=<not set>
NO_COLOR=<not set>
MANPAGER=<not set>

Config file

Could not read contents of 'C:\Users\timoxa\AppData\Roaming\bat\config': Системе не удается найти указанный путь. (os error 3).

Compile time information

  • Profile: release
  • Target triple: x86_64-pc-windows-gnu
  • Family: windows
  • OS: windows
  • Architecture: x86_64
  • Pointer width: 64
  • Endian: little
  • CPU features: fxsr,sse,sse2
  • Host: x86_64-pc-windows-msvc

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions