Skip to content

Copying Agent responses corrupts Unicode chars (…, —, → become mojibake) #89

Description

@jonaswebdev

Bug

Copying Agent response text out of Switchboard corrupts certain Unicode characters. Clipboard content shows mojibake instead of the actual glyph.

Observed mapping

Expected Got (clipboard)
(ellipsis, U+2026) ‚Ħ
(em dash, U+2014) —
(right arrow, U+2192) ‚Üí

Likely cause

Pattern matches double-encoding mojibake: UTF-8 bytes for these chars get misread as Windows-1252/Latin-1 somewhere in the copy pipeline, then re-encoded as UTF-8 on top of that.

Example: = UTF-8 E2 80 A6. Read as CP1252 → …. Re-encode that string as UTF-8 → ‚Ħ. Same transform reproduces the and cases.

Suspect a spot in the copy handler (or a lib it calls) that does a Latin-1/CP1252 decode on already-UTF-8 bytes before writing to clipboard.

Repro

  1. Get an Agent response containing , , or .
  2. Copy it (button or manual select+copy — note which).
  3. Paste into plain-text editor.
  4. Chars show as ‚Ħ, ‚Äî, ‚Üí instead of originals.

Expected

Clipboard content matches on-screen text exactly.

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