"Why can't I type Ś in Medium?"
February 3, 2015 2:52 PM   Subscribe

This was odd. We don’t really special-case any language in any way, and even if we did… out of 32 Polish characters, why would this random one be the only one causing problems? Turns out, it wasn’t so random. This is a story of how four incidental ingredients spanning decades (if not centuries) came together to cause the most curious of bugs, and how we fixed it.
posted by Chrysostom (49 comments total) 61 users marked this as a favorite
 
Delightful read, thanks. As soon as he explained Alt-* for diacritics, I had a sinking feeling...
posted by RedOrGreen at 3:27 PM on February 3, 2015 [3 favorites]


An elegant description of a slightly complex problem and of finding the simplest solution available. A natural consequence of systems in long use, perhaps; like the cathedrals of old built over generations, each new wave of programmers (or mechanics, for the typewriter precursors) find fixes for bugs and lay down their own solutions in layers, altering the architecture for the next wave.

Also interesting to observe the clever ways Anglocentrically-engineered hardware/software was adapted for use by speakers of other languages (that share Latinate graphemes).
posted by The Zeroth Law at 3:59 PM on February 3, 2015 [2 favorites]


"Wow, breaking people's browsers can have unexpected side effects!"
posted by thelonius at 4:02 PM on February 3, 2015 [24 favorites]


Please send this ticket to the production support UI team. They'll validate the diagnosis and might have a release ready in about three weeks. Awesome find, though.
posted by Monsieur Caution at 4:05 PM on February 3, 2015


> "Wow, breaking people's browsers can have unexpected side effects!"

More like "wow, browsers are really broken". Why is Save still a default function? Why doesn't character entry automatically override Javascript? Why does Javascript even let you override Ctrl and Alt?
posted by archagon at 4:10 PM on February 3, 2015 [4 favorites]


Śuperb.
posted by nfalkner at 4:19 PM on February 3, 2015 [9 favorites]


reminds me a bit of having to deal with fixed format FORTRAN source code (pretend your favorite text editor is a card punch machine)
posted by indubitable at 4:19 PM on February 3, 2015 [3 favorites]


Why does Javascript even let you override Ctrl and Alt?

For the same reason Windows lets applications override Ctrl and Alt -- it's sometimes necessary. I doubt you want to use Google Docs without keyboard shortcuts.
posted by neckro23 at 4:22 PM on February 3, 2015 [9 favorites]


> For the same reason Windows lets applications override Ctrl and Alt -- it's sometimes necessary.

Yeah, but it shouldn't break system functionality. And it shouldn't be used as a way to get around terrible UI decisions (save dialog). I feel it's incredibly inconsistent when you don't know if your Ctrl/Alt shortcuts are going to the current app (the default behavior everywhere else) or to the website you happen to have open. It's like browsers don't quite know what they want to be: document viewers or micro-OSes.
posted by archagon at 4:28 PM on February 3, 2015 [3 favorites]


I was taking the impression that they were wanting to just interfere with people trying to save pages from their site. Am I just not seeing a real problem that they were trying to help with? If I have a browser in focus, I'd expect Ctrl + S to apply to the browser. Maybe I'm just old but the save dialog seems like expected behavior to me, not like terrible UI.
posted by thelonius at 4:47 PM on February 3, 2015 [3 favorites]


This was a good explanation of how these types of bugs crop up, though it maybe shouldn't be surprising to learn you've broken keyboard input if you're hijacking keyboard shortcuts.

A lot of my job as a software engineer is tracking down strange interactions between our code and Windows, and things like this come up all the time. It's discouraging to hear customers complain about how we missed some "obvious" bug that, it turns out, only happens on this one particular set of machines that shouldn't be special in any way. I'm at the point now where I never say "That can't possibly be our fault," no matter how ridiculous it sounds, unless our code isn't actually running. And even then it still might be our fault.
posted by Sibrax at 4:47 PM on February 3, 2015 [6 favorites]


Browsers definitely want to be micro-OSes. The idea of them being a document viewer died with Web 2.0.
posted by sbutler at 4:47 PM on February 3, 2015 [10 favorites]


This reminds me of a CHARACTER ENCODING NIGHTMARE (a phrase that should invoke actual nightmares, if not an instant case of the chills in programmers) that I ran into some time ago.

A certain CRM product was used by my employer, mostly at that time in North America and Western Europe, and.. Poland. Unicode wasn't really a thing yet (and, for most older systems, still isn't (wtf)) and all of the data stored was in good old western european encoding. If you've dealt with this sort of thing, you're mouthing the ISO spec number right now.

For Poland, rather than have true internationalization turned on, there was a third-party patch that slammed input from Polish users into the database somehow. Which actually worked fine, until we connected middleware. And web applications to that middleware. XML-based middleware, which did amazing things like validation and parsing of character sets.

At that point, it became a challenge to see when, and where, you'd have to keep injecting LIES to get around the parsers. I think eventually I got an intranet site to correctly display Polish locations and names, but it's better left unremembered.
posted by mikeh at 4:54 PM on February 3, 2015 [6 favorites]


I recall reading that, around the time of the Iron Curtain coming down, long before Unicode, and before the semi-standard 8-bit codepages for Central/Eastern Europe were created, enterprising individuals were importing computers (both IBM PCs and various 8-bit machines) to Poland and Czechoslovakia and coming up with their own custom localisations; i.e., patching the character bitmaps and remapping keys from little-used punctuation characters to letters with diacriticals. Which means that there would have been islands of grey-market computers with their own idiosyncratic ways of encoding Ł and Č and such, and should text ever make it from one island to another, it would have suffered from a hell of a case of mojibake.
posted by acb at 5:09 PM on February 3, 2015 [1 favorite]


thelonius: "I was taking the impression that they were wanting to just interfere with people trying to save pages from their site. Am I just not seeing a real problem that they were trying to help with?"

Almost. What they wanted to do was make ^S in the browser behave like ^S in a word processor (i.e. save what you'd typed, not save what you're viewing).

The real problem is that people have become habituated to not thinking about or taking notice of what's going on in front of them. And Medium were only too happy to help them with that. But, to do so, they deliberately broke existing browser functionality on part of their website, and in the process they unwittingly broke Ś.

The history behind it is interesting and all, but the fault is entirely because they thought they knew better how your browser should behave…
posted by Pinback at 5:15 PM on February 3, 2015 [1 favorite]


OK, thanks - I did miss that this was the point
posted by thelonius at 5:34 PM on February 3, 2015


It's like browsers don't quite know what they want to be: document viewers or micro-OSes.

People want to use web browsers to look at documents, but they also want to use them as a platform to run their web app clients. Gmail, facebook, google maps, youtube, & google docs, are all examples of this, as are innumerable things on innumerable intranets (expense reports, payroll systems, etc). Any app you use a lot, keyboard shortcuts can be super useful, to the point where if a browsers doesn't support them, the app may instead choose not to support that browser.
posted by aubilenon at 5:44 PM on February 3, 2015 [3 favorites]


The history behind it is interesting and all, but the fault is entirely because they thought they knew better how your browser should behave…

Let's be real, though: Saving the entire page to disk is not what anyone ever wants Ctrl+S to do while you're working with an editable portion of that page. The Medium platform is implementing the expected behavior, an expectation which browser vendors have chosen to continue to violate. Who even saves webpages anymore? Do we really still need a hotkey for that?
posted by WCWedin at 6:02 PM on February 3, 2015 [13 favorites]


Yeah, I feel its pretty contextual. If the "page" is an image (like when you open an image in a new tab) or PDF or something, save makes sense. But for most web pages today, "saving" just results in some folder full of images, scripts, etc that tries to let you view it offline but probably wont work.
posted by thefoxgod at 6:08 PM on February 3, 2015 [2 favorites]


> People want to use web browsers to look at documents, but they also want to use them as a platform to run their web app clients. Gmail, facebook, google maps, youtube, & google docs, are all examples of this, as are innumerable things on innumerable intranets (expense reports, payroll systems, etc). Any app you use a lot, keyboard shortcuts can be super useful, to the point where if a browsers doesn't support them, the app may instead choose not to support that browser.

Right, absolutely. Which is, I think, a strong indicator that the browser and the web in general need a ground-up redesign. I feel it whenever I accidentally highlight part of the text on a page, revealing the ugly divs underneath; whenever I experience crippling, non-native behaviors and performance on my phone; whenever I look at the insane CSS hacks and div soup required to get even the most basic web apps off the ground. The whole thing just feels so fragile.

If you think about it, it's kind of funny that one of the most pervasive, complex app ecosystems is built on top of a platform designed for document viewing!
posted by archagon at 6:09 PM on February 3, 2015 [2 favorites]


This was a great article, thanks for posting it.
posted by curious nu at 6:14 PM on February 3, 2015


What was interesting to me was that the bug would have been a huge pain in the ass for someone who didn't understand the history of Polish keyboard adaptation.
posted by srboisvert at 6:21 PM on February 3, 2015 [1 favorite]


Actually, the thing that made me cringe the most was hearing that left-alt and right-alt meant two different things. I imagine you could really screw thins up by something similar with the shift keys.
posted by CheeseDigestsAll at 6:35 PM on February 3, 2015


Child #1: I'm getting worried about mom- did you see the email I forwarded you?
Child #2: Yeah, I don't think that thing is nearly as popular or functional as the kindle.
Child #1: Wait.... what?
Child #2: ....
Child #1: Ohhhh.... żądanie kąta.... nevermind.

END SCENE
posted by stinkfoot at 6:47 PM on February 3, 2015 [2 favorites]


I once copyedited a magazine article about a typographer who was working on digital fonts for non-Latin scripts and Latin scripts with missing diacritics.

Shamefully enough, the magazine's house font lacked the diacritical mark that would have allowed us to display the typographer's name correctly.
posted by evidenceofabsence at 6:49 PM on February 3, 2015 [4 favorites]


I used to think that Unicode would one day make my job obsolete. Fortunately each layer of technology is overlaid upon the previous generation, like an archaeological dig. So I'll be digging down to the 1980s for basically forever. Figuring out Polish input in a browser is easy, when compared to doing Burmese in InDesign.

It's like that Ken Macleod book where the mid-21st-century project manager has to go to the pub to find greybeards advertising their skills with threadbare t-shirts from Oracle or Slashdot or whatever. Gonna be one of those dudes someday.

Waaait... (looks in mirror) THE FUTURE IS NAO
posted by BrunoLatourFanclub at 6:58 PM on February 3, 2015 [2 favorites]


Actually, the thing that made me cringe the most was hearing that left-alt and right-alt meant two different things.

What made me cringe is that after using the left (and only) Alt for a bunch of years, they made that one do something else instead of keeping it the same and making the new button do the new thing.

Anyway, now that they've fixed the Ś, maybe Medium can get around to fixing its gigantic, kindergarteny text size so I don't have to groan and scroll,scroll,scroll,scroll,scroll every time I find myself there.
posted by Sys Rq at 7:02 PM on February 3, 2015 [1 favorite]


The Ctrl-S to Save hotkey is annoying not so much because people don't use save-to-disk functionality, but that what people actually do isn't typically save-as-HTML, which is all you can do from that dialog, but save-to-PDF, which requires you to go through the Print dialog for more or less historical reasons.

They ought to move the ability to save as a PDF to the Save dialog (retaining it for a few versions from within the Print dialog as well, so as not to anger people), and that would go a long way towards justifying the continued existence of Ctrl-S.

There should also be a sort of permissions-granting screen that comes up whenever you go to a page whose JavaScript is trying to do crazy shit with your UI. Hotkeys, overriding right-click actions, etc. That shit is annoying as hell.
posted by Kadin2048 at 7:20 PM on February 3, 2015 [1 favorite]


how we fixed it.

Adding new cruft is not really a proper fix for old cruft.
posted by charlie don't surf at 7:33 PM on February 3, 2015 [2 favorites]


But nuking the old cruft can have unintended consequences. You never know how many people are using the heck out of a weird keyboard shortcut that was never really planned, only created by cruft, until you release a service pack that implements a standard that takes it away.
posted by elizilla at 8:23 PM on February 3, 2015 [2 favorites]


And some people still think 'intelligent design' is a better explanation of our world than 'evolution through selection of the fittest through random mutation'.
posted by Devonian at 9:31 PM on February 3, 2015 [1 favorite]


Ohhhh shit wait till they find out about Asia
posted by Doleful Creature at 9:48 PM on February 3, 2015 [1 favorite]




What you say is true, elizilla, and obvious. I just think it's framed in a ridiculous manner. The author claims he fixed a bug. It wasn't a bug, it was a feature. It wasn't a fix, it was a hack. The new hack is worse than the original feature.

Hey let's check the old Hacker's Dictionary. I will abridge it a little, but not enough to distort meaning.

FEATURE n. 1. A surprising property of a program. See BUG. "That's not a bug, that's a feature." A bug can be changed to a feature by documenting it.

But hacking the old cruft can have more unintended consequences, since each new hack will be seen by the next guy as cruft. So it will eventually it will need to be hacked again, and over the long term, it will become infinite hair.

HAIR n. The complications which make something hairy. "Decoding TECO commands requires a certain amount of hair." Often seen in the phrase INFINITE HAIR, which connotes extreme complexity.

Old cruft is hard to kill, but it must be killed. It can be done. If we couldn't kill cruft, our keyboards would still have keys labeled HERE IS, RUB OUT, REPT, and BREAK.
posted by charlie don't surf at 10:11 PM on February 3, 2015 [2 favorites]


Old cruft is hard to kill, but it must be killed.

Pretty much this, and the unintended consequences come more from overloading the functionality of a web browser into a text editor.

Besides, everyone knows the one true way to save a document is ^[:w^M
posted by lawrencium at 11:36 PM on February 3, 2015 [2 favorites]


If we couldn't kill cruft, our keyboards would still have keys labeled HERE IS, RUB OUT, REPT, and BREAK.

A bunch of us still have one of those...
posted by Dysk at 1:02 AM on February 4, 2015


charlie don't surf: "If we couldn't kill cruft, our keyboards would still have keys labeled HERE IS, RUB OUT, REPT, and BREAK."
Instead I have SysRq and Scroll Lock which are of course much more useful? At least I could use a RUB OUT from time to time.
posted by brokkr at 4:09 AM on February 4, 2015 [2 favorites]


What are you implying
posted by Sys Rq at 7:35 AM on February 4, 2015 [6 favorites]


Though, in all seriousness, RUB OUT would be a handy universal for the backspace/delete divide. ("DELETE" IS SOMETHING ELSE, APPLE! Don't even get me started on this "return" business.)
posted by Sys Rq at 7:39 AM on February 4, 2015


Any app you use a lot, keyboard shortcuts can be super useful, to the point where if a browsers doesn't support them, the app may instead choose not to support that browser.

This is really depressing. I assumed that this kind of control-key hijacking nonsense was just another case of arrogant web designers taking advantage of browser bugs, and that it would eventually get straightened out once the browser makers caught up with them. If what you're saying is true, then not only are we stuck with this stuff, but it's only going to get worse.

I hate the web.
posted by Mars Saxman at 11:27 AM on February 4, 2015


If what you're saying is true, then not only are we stuck with this stuff, but it's only going to get worse.

I don't think we'll really see this getting worse. Web apps already can and do monkey with keyboard shortcuts, and have done so for quite some time, and I tihnk we're mostly at equilibrium now between the two conflicting pulls on webapps' UI and general design. Users want to feature / usability parity with native apps, but also don't want normal browser behavior (back/forward, bookmarks, tabs, etc) to break. I think as users become more and more used to webapps, this equilibrium will probably move a little towards webbiness. But hot keys are still here to stay. I doubt MetaFilter will drop Ctrl+I as a shortcut to italicize text; that's useful and not disruptive. But nor can they ever override Ctrl+R, because that'd stymie everyone who expects it to reload the current page.
posted by aubilenon at 12:17 PM on February 4, 2015 [1 favorite]


The only reason I knew this kind of control-key hijacking was even possible is that the Outlook web app I occasionally have to use for work steals Ctrl+N, which stymies everyone who expects it to create a new browser window.

I guess the problem is that I emphatically don't want feature parity with native apps- I want web pages to shut up and stay where they're put and not try to take over the machine. It's my computer, not the designer's, and they shouldn't be able to make decisions for me about what my machine does.
posted by Mars Saxman at 12:30 PM on February 4, 2015


This would be a perfect place to note how I despise MetaFilter's annexation of my ability to use control-B to move my cursor backwards. Especially since ctrl-F, ctrl-N, and ctrl-U work just fine. Grr.
posted by bouvin at 12:44 PM on February 4, 2015


I guess the problem is that I emphatically don't want feature parity with native apps- I want web pages to shut up and stay where they're put and not try to take over the machine. It's my computer, not the designer's, and they shouldn't be able to make decisions for me about what my machine does.

I, uh, what? It's like you've never used a native app before.

You know what drives me nuts? Illustrator has the One True Shortcut for Redo, Ctrl+Shift+Z. Anyone who thinks their app should implement it as something impossible to one-hand like Ctrl+Y or Ctrl+R is committing a grave crime against my fingers. Even Photoshop badly bungles this by mapping arcane shortcuts to so-called "History" actions, which is just a fancy undo stack. Word is worse – Ctrl+Shift+Z maps to "remove formatting" or something, which clobbers your undo stack. It would be great if all of these app designers didn't take over my machine all the time, but that's sort of the point of applications, isn't it? To provide domain functionality on a general-purpose device?

The difference is that most (decent) apps allow you to customize shortcut keys. That's the thing that needs to come to the web. Someone needs to put together a tight library for capturing shortcut keys, with a skinnable UI and built-in local/remote saving. Being open source is widely-used, problems like these would eventually get solved for everyone at once; every developer would get the right behavior for free, instead of having to discover bugs on their own. If such a thing already exists, it needs some evangelizing so that web developers large and small no longer try to home-brew something as deceptively complex as keyboard shortcuts.

The web is a platform now, and those kids aren't getting off anyone's lawn. We should embrace it and make it as good as possible.

Aside: Calling web developers "designers" is sort of disparaging, don't you think? Sure, some people are only designers, and some are only programmers, but usually web development takes at least a little of both to get anything done. The days of design having center stage all to itself on the web are long gone. I would even say the day to mourn those days is over by now, too.
posted by WCWedin at 4:54 AM on February 5, 2015 [3 favorites]


You guys' problems would all be solved if you used Macs, which never use the control key. You can program control keys however you like and it will never conflict with anything.
posted by charlie don't surf at 9:46 AM on February 5, 2015


The web is a platform now, and those kids aren't getting off anyone's lawn. We should embrace it and make it as good as possible.

This is where we differ. I choose the apps I'm going to install and not install. Code doesn't get to run on my machine unless I decide I trust the people who wrote it, and if I don't trust the people who wrote it then I simply don't install the app.

With this web as platform idea, it's like anyone in the world can take over my machine just by tricking me into visiting their web site. NOT COOL. The browser is supposed to be protecting me from this kind of crap, not abetting it! The browser is supposed to be a secure sandbox, keeping all this wild and crazy unknown foreign code boxed up where it can't do any harm. Why on earth are browsers simply letting web pages take over just for the asking, without even giving me a warning or a chance to cancel? This is broken.
posted by Mars Saxman at 11:27 AM on February 5, 2015


The webapp's control over what a keyboard combination does is limited to the browser tab in which it is running. It's not taking over your machine.
posted by aubilenon at 2:36 PM on February 5, 2015 [1 favorite]


WCWedin: "something impossible to one-hand like Ctrl+Y or Ctrl+R"

*practices hitting various Ctrl-key combinations*

Do you have extremely small hands, or something? I'm a person of reasonably delicate fingers, and Ctrl-Y and Ctrl-R are both easily one-handable for me.
posted by Lexica at 4:28 PM on February 7, 2015


Calling web developers "designers" is sort of disparaging, don't you think?

I don't know about disparaging, but it's sure inaccurate. (Have you seen the web lately? It could use some designers.)
posted by Sys Rq at 4:50 PM on February 7, 2015


« Older since 2009, 1,891 UVM students have specified a...   |   The Magnificent Spinster Newer »


This thread has been archived and is closed to new comments