-
-
Notifications
You must be signed in to change notification settings - Fork 21
Closed
Description
Issue: Incorrect Placement of BOM When Adding Copyright Headers
Description:
When using Hawkeye to add copyright headers to files encoded in UTF-8 with BOM, the header is added at the very first character of the file.
This results in the BOM being moved behind the header, which can cause issues with file encoding recognition.
Steps to Reproduce:
- Create a file encoded in UTF-8 with BOM.
- Use Hawkeye to add a copyright header to the file.
- Observe the placement of the BOM in the file.
Expected Behavior:
The BOM should remain at the very beginning of the file, with the copyright header added after it.
Actual Behavior:
The BOM is moved behind the copyright header, which can cause encoding issues.
Example:
Original file content:
using System;
namespace Some.Fake.Namespace;
public class SomeFakeClass
{
public void SomeFakeMethod()
{
Console.WriteLine("Hello, World!");
}
}
Resulting file:
// Copyright (c) 2023
using System;
namespace Some.Fake.Namespace;
public class SomeFakeClass
{
public void SomeFakeMethod()
{
Console.WriteLine("Hello, World!");
}
}
PR with a demo test in preparation. Will add a link once its there....
Lorilatschki
Metadata
Metadata
Assignees
Labels
No labels