vibeapp.win

What broke

An em dash closed a string: the evening deploy died with exit 1 and no log

A scheduled evening deploy for the stock app ended with exit 1 and no log, because Windows PowerShell 5.1 read a BOM-less UTF-8 script as cp1252 and an em dash turned into a closing quote. Eight more scripts had the same flaw, and a test now requires a BOM on every .ps1 file that contains non-ASCII bytes.

The short version

What went wrongA BOM-less UTF-8 PowerShell script was read as cp1252, so an em dash became a closing quote. The evening deploy failed at parsing with exit 1 and no log.

How we found itThe next morning the missing log showed the script never ran. The cause was an em dash in a script saved without a BOM. Eight other scripts had the same flaw.

The rule nowEvery .ps1 file with non-ASCII characters must be UTF-8 with a BOM, and a test enforces it. A scheduled job with no log is treated as not run.

This post documents something Claude got wrong. The claim rests on a commit or a file, not on memory. All of Claude's mistakes

On the evening of 6 November 2026 a scheduled task was set to deploy a new version of the stock app’s API. It started at 22:20 and ended with exit code 1. It wrote no log at all.

The next morning the cause turned out to be a single character: an em dash (—) in a PowerShell script that had been saved as UTF-8 without a byte-order mark.

Why there was an evening deploy at all

The stock app’s normal deploy script raises its own privileges through a Windows UAC prompt, so it can’t run from a Claude Code session. So Claude wrote a separate script for the evening: it runs the deploy steps without elevation and is started by a scheduled task. The header comment in that script says this. Like all the code in these repositories, Claude wrote it.

What went wrong

Windows PowerShell 5.1 guesses the encoding of a .ps1 file. If the file starts with a UTF-8 byte-order mark (the bytes EF BB BF), it reads the file as UTF-8. If there is no BOM, it reads the file in the legacy Windows code page, cp1252.

In UTF-8 an em dash is three bytes: E2 80 94. In cp1252 those bytes are three separate characters, and the last one, 0x94, is a right double quotation mark. PowerShell treats that curly quote as a real quote character. So when the em dash sat inside a string, the third byte closed the string early, and the rest of the line no longer made sense to the parser.

The script never got past parsing. PowerShell rejects the whole file before it runs the first line. The script was supposed to start a transcript (its own log) near the top, so the logging never started. That is why the task gave nothing except exit 1.

That last detail is the important one. A missing log looks like nothing happened, or like something ran and stayed quiet. Here it meant the script never ran at all. The progress log Claude keeps for the project puts it this way: absence of a log means absence of a run. It files this under a known class of errors: treating silence as reassurance.

The fix, and the morning after

On Saturday 7 November at 07:35 Claude committed the first fix: the same script, now with a UTF-8 BOM in front of the first line. Nothing else in the file changed. The deploy was then run manually that morning.

Eight more scripts with the same flaw

Two minutes later, at 07:37, a second commit followed. Claude had checked the other PowerShell scripts in the repository and found eight more saved as UTF-8 without a BOM that contained non-ASCII characters. They covered backup and restore of the database, several recovery and maintenance scripts, a one-time setup script for Henning, and a setting that stops Windows Update from restarting the host on its own.

None of them had failed yet. According to the commit message they still parsed only because the Norwegian letters (æ, ø, å) and the dashes appeared in comments and in printed output, not in places where a stray quote character would break the syntax. In a comment, a misread byte gives garbled text and nothing else. The progress log calls this parsing by luck. One edit that put an em dash inside a quoted string in any of those scripts would have caused the same silent failure.

Several of the scripts’ comments spell Norwegian words in ASCII, with “aa” for å and “oe” for ø, but the box-drawing lines and dashes in the same headers were not ASCII. All eight got a BOM in the same commit.

The guard

The second commit also added a test to the stock app’s test suite. It reads every .ps1 file in the scripts folder and checks one rule: if the file contains any byte above 0x7F, which means any non-ASCII character, it must start with the UTF-8 BOM. Pure-ASCII files pass without a BOM, because cp1252 and UTF-8 read ASCII the same way. The test also checks that it actually found script files, so a moved folder can’t make it pass by testing nothing.

The test works on bytes, not on what the script means. It does not try to work out whether a non-ASCII character sits somewhere dangerous.

The incident is also recorded in the project’s instruction file, which Claude Code reads at the start of every session, together with the name of the test. So a later session that writes a new PowerShell script will run into the rule before it writes one, not after a deploy fails.

What we take from it

  • The bug was in a file Claude wrote, and the cause was the file’s encoding, not its logic.
  • The failure gave no feedback: exit 1, no log. The only clue was that the log was missing, and the useful reading of that was “this never ran”, not “this ran quietly”.
  • The fix for one file was one invisible character. Finding the eight others with the same risk mattered more, because they were working by luck.

The rule

Every .ps1 file in the repository that contains a non-ASCII character must be saved as UTF-8 with a byte-order mark, and a test enforces it. A scheduled job that leaves no log is treated as a job that did not run until we have shown otherwise.