Skip to content

Replace em dash in serialize-dialog.js comment w/ ASCII dash#2203

Open
davidrunger wants to merge 1 commit intopercy:masterfrom
davidrunger:patch-1
Open

Replace em dash in serialize-dialog.js comment w/ ASCII dash#2203
davidrunger wants to merge 1 commit intopercy:masterfrom
davidrunger:patch-1

Conversation

@davidrunger
Copy link
Copy Markdown

The em dash (U+2014 EM DASH) being replaced in this change with a simple dash (U+002D HYPHEN-MINUS) causes a problem for me (and maybe/probably other people). The em dash ultimately causes Ruby's HTTP library (which I use via the percy-capybara gem) to interpret a certain HTTP response from the Percy server as having a binary encoding, rather than a UTF-8 encoding, which then causes a warning from the json gem (/home/runner/work/david_runger/david_runger/vendor/bundle/ruby/4.0.0/gems/json-2.19.4/lib/json/common.rb:445: warning: JSON.generate: UTF-8 string passed as BINARY, this will raise an encoding error in json 3.0).

Replacing the em dash with a simple ASCII dash avoids this issue.

The non-ASCII dash was introduced in the latest released Percy version (1.31.12) via #2185.

The em dash (U+2014 EM DASH) being replaced in this change with a simple dash (U+002D HYPHEN-MINUS) causes a problem for me (and maybe/probably other people). The em dash ultimately causes Ruby's HTTP library (which I use via the `percy-capybara` gem) to interpret a certain HTTP response from the Percy server as having a binary encoding, rather than a UTF-8 encoding, which then causes a warning from the `json` gem (`/home/runner/work/david_runger/david_runger/vendor/bundle/ruby/4.0.0/gems/json-2.19.4/lib/json/common.rb:445: warning: JSON.generate: UTF-8 string passed as BINARY, this will raise an encoding error in json 3.0`).

Replacing the em dash with a simple ASCII dash avoids this issue.

The non-ASCII dash was introduced in the latest released Percy version (1.31.12) via percy#2185.
@davidrunger davidrunger requested a review from a team as a code owner April 29, 2026 05:23
@davidrunger
Copy link
Copy Markdown
Author

davidrunger commented Apr 29, 2026

As a side note, I see that the bottom of the PR #2185 that introduced the issue that this PR aims to correct states:

🤖 Generated with Claude Code

I certainly appreciate that transparency!

LLMs are well known for their fondness for em dashes.

If it is possible to take some measure to minimize the likelihood of LLM agents such as Claude Code from introducing em dashes into code (e.g. by adding an AGENTS.md file to this GitHub repo with instructions not to use non-ASCII characters in code (including code comments)), then that would probably be valuable, to avoid issues similar to that which this PR aims to correct from being introduced by Claude again in the future.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant