YAML with UTF-8 BOM are not handled correctly
Brief description of your issue
If you use YAMLs for the manifest and use UTF-8 with BOM, the first line is completely ignored. The first line usually holds the schema header. This might be a problem for a long time, but headers are checked now and if you use UTF-8 with BOM, the checks will fail. Currently UTF-8 with BOM only works, if you place the schema header in the second line, leaving the first line blank. Or using UTF-8 without BOM.
Steps to reproduce
Use a YAML with UTF-8 with BOM, place the schema-header in the first line and run the validate
Expected behavior
The obe described usage should work
Actual behavior
The first line is ignored
Environment
Windows-Paket-Manager (Vorschau) v1.11.320-preview
Copyright (c) Microsoft Corporation. Alle Rechte vorbehalten.
Windows: Windows.Desktop v10.0.26100.4061
Systemarchitektur: X64
Paket: Microsoft.DesktopAppInstaller v1.26.320.0
The current azure tests will fail also!
Can you provide an example of what you're expecting to work?
Unfortunately YAML is not an allowed file type. But you can have a look on \manifests\t\TUitTUWien\TUtoolbox\2025.1.0.707\TUitTUWien.TUtoolbox.installer.yaml Or is there another way to upload a file? To upgrade to our current version I needed to save the manifest without BOM and the schema header was recognized. So this is working: \manifests\t\TUitTUWien\TUtoolbox\2025.1.0.711\TUitTUWien.TUtoolbox.installer.yaml
If you use a tool such as YamlCreate, WinGet Create, or Komac, the files will be output in the correct format and will not have the BOM
Alternatively, you can save it without BOM using any editor. However, this is still a bug in Winget. The BOM may never lead to the first line being ignored.
YAML intrinsically supports UTF-8. I don't see any reason to do extra work to support a BOM when it isn't required.
Thanks @Trenly!
The less BOMs there are in the ecosystem the better. Better to enforce a strict UTF-8 without BOM everywhere. Seeing more and more people move away from BOM as it's weird and causes issues and the problem it tried to fix really doesn't exist anymore with modern editors and programs.