Skip to content

streamdeck_read_profiles fails on Windows with UTF-8 profile/page manifests #39

@kodroi

Description

@kodroi

Summary

On Windows, streamdeck_read_profiles can fail with:

UnicodeDecodeError: ''charmap'' codec can''t decode byte 0x8d ...

when any Stream Deck profile or page manifest.json contains non-ASCII UTF-8 content such as emoji.

Reproduction

  1. Create or edit a Stream Deck profile page so a page manifest contains UTF-8 text, for example: "pastedText": "👍"
  2. Run the MCP server via uvx streamdeck-mcp
  3. Call streamdeck_read_profiles

Actual

The server crashes while reading profile/page manifests on Windows with a charmap / cp1252 decode error.

Expected

Profile and page manifests should load successfully regardless of UTF-8 content.

Root cause

profile_manager.py reads profile JSON with Path.read_text() without specifying an encoding, so Windows uses the process default ANSI codepage instead of UTF-8.

Affected helper:

  • _load_json(path) -> json.loads(path.read_text())

Proposed fix

Read and write profile manifests explicitly as UTF-8:

  • path.read_text(encoding="utf-8")
  • write_text(..., encoding="utf-8")

Notes

I reproduced this against a real Stream Deck profile where a page manifest contained "pastedText": "👍", and confirmed the failure occurs in streamdeck_read_profiles while building page refs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions