Replace em dash in serialize-dialog.js comment w/ ASCII dash#2203
Replace em dash in serialize-dialog.js comment w/ ASCII dash#2203davidrunger wants to merge 1 commit intopercy:masterfrom
Conversation
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.
|
As a side note, I see that the bottom of the PR #2185 (cc author @yashmahamulkar-bs) that introduced the issue that this PR aims to correct states:
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 |
|
Hi, @davidrunger thanks for raising the issue and appreciate your efforts on fixing this. I have ran the spec and will merge it as the specs passes. |
The em dash (U+2014 EM DASH) that is 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-capybaragem) 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 thejsongem (/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.