RC RANDOM CHAOS

How communism, Ctrl+S, and Windows conspired to eat Poland's Ś on Medium

· via Hacker News

Original source

The curious case of the disappearing Polish S (2015)

Hacker News →

A Medium user reported a bug that made no sense: writing in Polish, every character typed fine except Ś, which simply vanished — and only on Medium. The cause turned out to be four unrelated historical accidents converging. Polish extends the Latin alphabet with nine diacritics, and because communist-era Poland couldn’t commercially import Western computers, users were stuck with American keyboards and improvised a ‘programmer’s’ layout that maps those extra letters onto Alt+key combinations — so Ś is typed as Alt+S.

The other two ingredients came from software. Decades of crash-prone machines drilled a reflexive Ctrl+S / Cmd+S save habit into writers, so Medium added a handler that intercepts that combination to suppress the browser’s useless ‘save this webpage’ dialog, calling preventDefault() to swallow the event. The final piece is Windows, which implements its typing-Alt (AltGr) as Ctrl+Alt under the hood. That means pressing Alt+S to produce Ś arrives at the browser looking like Ctrl+S — exactly the shortcut Medium was blocking. The save handler fired, preventDefault() ran, and the letter never made it into the document.

The takeaway is a classic study in how brittle edge cases emerge: no single decision was wrong, but a keyboard layout born of cold-war scarcity, a muscle-memory shortcut, an over-broad event handler, and a quirk of how Windows encodes modifier keys combined to silently break one character for an entire language. It’s a useful reminder for anyone writing keyboard-handling code that internationalized input and modifier semantics differ across platforms, and that intercepting key combinations can have consequences far outside the case you intended.

Read the full article

Continue reading at Hacker News →

This is an AI-generated summary. Read the original for the full story.