Skip to content

Fix SBOM encoding error on Windows#27

Merged
popey merged 1 commit intomainfrom
fix-encoding-issue-14
Nov 16, 2025
Merged

Fix SBOM encoding error on Windows#27
popey merged 1 commit intomainfrom
fix-encoding-issue-14

Conversation

@popey
Copy link
Copy Markdown
Owner

@popey popey commented Nov 16, 2025

Fixes #14

Summary

Adds explicit UTF-8 encoding when opening SBOM JSON files, resolving encoding errors on Windows systems.

Changes

  • Modified load_json() in grummage.py to specify encoding="utf-8" parameter
  • Single line change for cross-platform compatibility

Technical Details

  • Windows defaults to cp1252 encoding, which cannot properly read UTF-8 encoded JSON files
  • UTF-8 is the standard encoding for JSON per RFC 8259
  • This fix works across all platforms (Windows, Linux, macOS)
  • Maintains backward compatibility with existing SBOM files

Testing

User should test with UTF-8 encoded SBOM files on Windows to verify the fix resolves the encoding error.

Co-Authored-By: Jim Harbin

- Add explicit UTF-8 encoding when opening JSON files
- Fixes issue where Windows defaults to cp1252 encoding
- UTF-8 is cross-platform compatible and JSON standard
- Resolves #14

Co-Authored-By: Claude <noreply@anthropic.com>
@popey popey merged commit a5c38d3 into main Nov 16, 2025
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SBOM Encoding File Opening Error

1 participant