4 ms·
I wonder how they used programming languages which assign special meaning to those characters; use ASCII and the code looks fine but string constants with those
by userbinator 12y ago
I wonder how they used programming languages which assign special meaning to those characters; use ASCII and the code looks fine but string constants with those characters will be very odd, use the local variant and the string constants look better but the code worse.
foo[1] = "\r\n";
fooÄ1Å = "ÖrÖn";
Perhaps it's something you just get used to after a while. The standard QWERTY keyboard has a reversed form of this "caseness" , with lowercase being []\ and their "uppercase" shifted versions {}|.
- pavlov 12y agoI was using MS-DOS back then. It had a command for changing the "code page", which would determine the appearance of special characters. (I imagine it was technically switching between preset character sets on the video card's character generator.) So when you wanted to do word processing, you would first switch to the code page that has the Nordic characters. For programming, you'd switch to the US code page. I don't know how real operating systems handled it :)
- dragonwriter 12y ago> I was using MS-DOS back then. It had a command for changing the "code page", which would determine the appearance of special characters. (I imagine it was technically switching between preset character sets on the video card's character generator.) It still exists in Windows, for the same purpose. https://technet.microsoft.com/en-us/library/cc733037.aspx https://technet.microsoft.com/en-us/library/cc733037.aspx
- thristian 12y agoI think C89 introduced 'trigraphs' for exactly that reason: so people using non-ASCII ISO646 systems could have symbols that at least vaguely resembled the ones Ritchie and Kernighan intended: http://en.wikipedia.org/wiki/Digraphs_and_trigraphs#C http://en.wikipedia.org/wiki/Digraphs_and_trigraphs#C
- dietrichepp 12y agoIn Japan, they'll write C code with printf("Hello, world!¥n"); (This may be less common today.)
- TazeTSchnitzel 12y agoIt's not actually. For compatibility, Japanese fonts display \ as ¥.
- ptaipale 12y agoBTW, the cases are other way round: {|} are lower case äåö and [\] are upper case ÄÖÅ. That is important for sorting order in strings. The sorting wasn't flawless though, because in ASCII these are ordered {, | and } but the proper (Swedish and Finnish) collation of the end of alphabet is ...xyzåäö. So unless you specifically programmed around it, you'd get slightly incorrect sorting. Yes, you would get used to having ÄÅ and äå as brackets and braces in programming. If this thing came back I'd be in an hour happily saying things like: while(<¤fh>) ä Él=split ' '; print "¤lÄ0Å, ¤lÄ3ÅÖn"; å