25

Note to close-voters: There is a meta question concerning the on-topicness of this question. Please provide an answer or comment. A comment from downvoters wouldn't hurt either.


The UK QWERTY keyboard layout has the button labelled with a split pipe type an unsplit pipe | (via Shift + \) and the button labelled with an unsplit pipe type a split pipe ¦ (via Ctrl + Alt + ` or Alt Gr + `).

The France AZERTY and Germany QWERTZ layouts have a single split pipe ¦ that types an unsplit pipe | (via Alt Gr + 6 and Alt Gr + < respectively).

The France AZERTY keyboard layout, courtesy Wikimedia Commons contributors:

The France keyboard layout

When and why did the convention of labelling keys with the "wrong" bar(s) on keyboards for PCs originate?

wizzwizz4
  • 18,543
  • 10
  • 78
  • 144
  • 10
    Because they're the same character, at least historically. Whether the character was displayed with one line segment or two was a choice of the font. https://en.wikipedia.org/wiki/Vertical_bar#Solid_vertical_bar_vs_broken_bar –  Jun 24 '17 at 14:39
  • 9
    If they're the same character they can't be the wrong way around. It's relatively modern notation that they're separate characters, one that's not observed well in practice. My keyboard has a | key with no break in it. It always generates an ASCII 0x7c character value, but whether or not that ASCII character is displayed as unbroken or broken vertical line depends on the font. In this comment text it's unbroken, in a Windows console it's broken. No US keyboard I have has two | keys, just one, usually a broken one. Your "US layout" laptop is either an exception or not actually a US layout. –  Jun 24 '17 at 16:25
  • @RossRidge Relatively modern, yes, but still well within the scope of the site. In the Windows console both ¦ and | are rendered with a break. There is a separate Unicode character for ¦. What I am asking is why, on many keyboard layouts, they are labelled the wrong way around. – wizzwizz4 Jun 24 '17 at 16:31
  • 3
    Because the notion that they're separate characters isn't respected. There are lots of characters that have multiple Unicode code points, but in ordinary usage are considered the same character. Consider A and A which may or may not be drawn differently but are both the upper case letter A to most people. –  Jun 24 '17 at 16:36
  • 5
    Not sure this is a retro question... – Joe Jun 24 '17 at 17:55
  • 3
    @Joe I've asked about it on meta. Please contribute an answer including your reasoning. – wizzwizz4 Jun 24 '17 at 19:38
  • 2
    Can't explain why a keyboard would have both | and ¦, but possible reasons for rendering | as ¦ could be: avoiding visual confusion with 1, I and/or l, and whatever key cap stencils you could get in time/price you need. Amstrad CPC and BBC Micro both had ¦ keycaps that generated |. Depending on the screen mode, | on a BBC Micro could render as |, ¦ or even ‖. There may not be a definitive or satisfactory answer to this question … – scruss Jun 25 '17 at 17:36
  • 1
    This is nothing to do with the keyboard itself. It is down to the keyboard driver to decide what character is generated on a keypress. – Chenmunka Jun 26 '17 at 07:54
  • 1
    I don't have a single keyboard (be it modern or retro) that would depict the vertical bar as a split bar. Either there is no visual representation at all (Apple keyboards, for example) or they used a non-split vertical bar for that character. So I would consider your primary assumption as a wrong one or a special feature of UK keyboards, although quite some of my keyboards are on UK computers. And I am really considering this question off-topic, as the distinction between a split bar and a none-split one cannot be made with plain ASCII, which used to be the main retro charset and encoding. – tofro Jun 26 '17 at 11:57
  • The only classic charset I know that actually distinguishes between both characters is IBM's EBCDIC, which has (at least in some national encodings) both characters. – tofro Jun 26 '17 at 12:18
  • 1
    @tofro That's odd. Every US English keyboard I have for IBM PC-compatibles has a split vertical bar. And my Apple keyboards do have a visual depiction, but it is a continuous vertical bar. (And I have a lot of keyboards :-p) So this is very likely a regional/layout issue, rather than a charset one. – Cody Gray - on strike Jun 26 '17 at 13:21
  • 1
    @CodyGray I think IBM (and everyone who copied them) went with the split bar because EBCDIC (IBM mainframes) traditionally used the split bar. All my HP keyboards have a continous bar, all my Sinclair QLs (German or UK keyboards) as well, All my Apples (3 xBooks) don't have it at all. The one UK Enterprise 128 I have uses a continuous bar as well. – tofro Jun 26 '17 at 13:27
  • 1
    @tofro I've seen many keyboards (I'm in the UK), mostly PC ones from the late 90s and early 2000s, with the issue. I remember specifically being confused about why I couldn't type a pipe symbol as a child when I first tried to start programming. Search for old UK PC keyboard on Google Images, you'll find things such as https://www.preater.com/modelm/images/model-m-front-large1.jpg and http://www.fentek-ind.com/kbukusbb.jpg . If you buy one today it will very likely have the correct symbol, hence why you couldn't find it. – Muzer Jun 27 '17 at 10:35
  • 1
    Comments are not for extended discussion; this conversation has been moved to chat. – wizzwizz4 Jun 27 '17 at 20:31
  • Upvoting this question, it's something I noticed too. I have a HP laptop and an external HP keyboard, both with Swiss QWERTZ keyboard. Laptop has an unsplit pipe on AltGr+1 and a split pipe on AltGr+7, and they type the opposite char, as you observed. But on the external keyboard these keys are switched (and hence correctly labeled). Odd. – dr_ Jun 29 '17 at 15:13

2 Answers2

21

ASCII was designed from the start with usable subsets (for instance an uppercase subset representable with six bits, consisting of the four central columns) and international variants. SHARE (IBM users' group) insisted that all characters needed for PL/I, included the vertical bar, were present in the uppercase subset(*). That was solved by allowing ! to be represented as a vertical bar, and by breaking the vertical bar present in the international non six-bit subset (7C). Later a broken bar was introduced in the upper part of latin-1 (A6).

The usage of breaking the character 7C persisted, notably in the ROM fonts of early IBM PC (for instance this Wikipedia capture of the ROM font of a VGA card). And we have the current situation where some fonts are using the broken bar for 7C although they shouldn't (doing a google image search for "ASCII bitmap font" shows both usages). Fonts for Latin-1 or Unicode (which shares the definition of graphical characters with Latin-1) tend to keep with the official definition (I've not found any which does not when writing this, but I'm pretty sure that in the past I've seen fonts which showed a broken bar for 7C and a continuous bar for 6A).

Keyboards show the same variations as fonts. Some have the key intended to type 7C showing a broken bar, others an unbroken one (I've just looked at mine, all have the French layout you give but two have a non-broken bar, one a broken one on key 6).

References:


* depending on sources, they insisted that it was in the non variable part as well

Matija Nalis
  • 515
  • 4
  • 15
AProgrammer
  • 481
  • 3
  • 5
  • Why does this mean that the keys are labelled wrong? Could you elaborate? – wizzwizz4 Jun 27 '17 at 16:17
  • 1
    The keys were wrongly labelled probably because many people thought they were the same thing. This was what it looked like on some of the incorrectly labelled CRT consoles. It isn't until you use the pipe command in DOS or the or operator in C and get an error that you find out whether you've typed ¦ instead of |. In the early 80s, I spent ages trying to figure out why ¦ was giving errors. It took a while to locate |. – cup Jul 01 '17 at 06:05
  • 1
    Was the caret/up-arrow used or the "not" character in PL/I? – supercat Jun 14 '18 at 20:19
  • 1
  • I believe Latin-1 is a superset of ASCII, and Unicode is a superset of Latin-1. So they should all agree on the definition of 7C. – Mark Ransom Jun 18 '21 at 19:20
  • @MarkRansom, yes they all agree. But fonts maker don't always follow the standard. That's quite common for ASCII, rare but I remember having seen it for Latin1 (apparently when I wrote the answer, I looked for examples but didn't find any, I didn't bother to look again for this comment), and I don't even remember having seen it for Unicode. – AProgrammer Jun 19 '21 at 14:55
  • 1
    The problem is that the standard never specified, or was inconsistent about it. The Unicode definition just says "Vertical Bar" and doesn't say if it should be broken or unbroken in the references I found. Wikipedia says in Solid vertical bar vs broken bar that the ASCII definition bounced back and forth a few times. From my point of view the broken bar is what I see most, by far. – Mark Ransom Jun 19 '21 at 18:06
7

When ASCII was being developed, the question of whether 0x7C was a broken or unbroken bar was considered no more meaningful than the question of whether character code 0x2A was a five, six, or eight-pointed asterisk, whether 0x27 was a vertical tick mark or one that sloped upward to the right, whether character code 0x7E was a tilde that was centered in its character box ~ or positioned higher ˜ so that printing it atop an n would yield ñ, etc. Over time, some of the fashions for how to visually represent such symbols have changed. Although Unicode added character codes for the old visual forms, machine-readable text needed to use the character codes the computer was expecting, rather than the character codes which, if rendered visually, would match the historical appearance of the old codes.

supercat
  • 35,993
  • 3
  • 63
  • 159