Skip to content

YAML with UTF-8 BOM are not handled correctly #5502

Closed

Description

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!

Activity

  1. denelon commented on Jun 2, 2025

    @denelon
    Collaborator

    Can you provide an example of what you're expecting to work?

  2. added
    Issue-BugIt either shouldn't be doing this or needs an investigation.
    and removed
    Needs-TriageIssue needs to be triaged
    on Jun 2, 2025
  3. chbwien commented on Jun 2, 2025

    @chbwien
    Author

    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

  4. Trenly commented on Jun 2, 2025

    @Trenly
    Contributor

    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

  5. chbwien commented on Jun 3, 2025

    @chbwien
    Author

    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.

  6. denelon commented on Jul 8, 2025

    @denelon
    Collaborator

    YAML intrinsically supports UTF-8.
    I don't see any reason to do extra work to support a BOM when it isn't required.

  7. denelon commented on Jul 10, 2025

    @denelon
    Collaborator
  8. Frulfump commented on Jul 25, 2025

    @Frulfump

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-BugIt either shouldn't be doing this or needs an investigation.

    Type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions