Skip to content

Add option to disable Unicode escaping of characters like & #436

@chroberino

Description

@chroberino

When merging SBOMs using the CycloneDX CLI, characters like & are currently encoded as Unicode escape sequences (\u0026) in the resulting JSON output, even though this is not required by the JSON specification.

Problem

Printable characters such as the ampersand (&) are unnecessarily escaped in the generated JSON:

"author": "ACME R\u0026D Team"

This reduces readability and creates noisy diffs in version control, even though these characters are perfectly valid in JSON when unescaped.

Feature Request

Please consider adding a CLI option such as --no-ascii-escape or --preserve-utf8 that outputs characters like & as-is, without escaping them to Unicode:

"author": "ACME R&D Team"

Benefits

  • Improves human readability of SBOM files
  • Reduces unnecessary changes in version control
  • Matches behavior of other JSON serializers like Python's json.dump(..., ensure_ascii=False)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions