Mon, 16 Jan 2006
Speaking of screwy character encodings, I have a theory about the origins of theAbominationThatIsCamelCase.
In the late 70's, I was a computer operator for a PDP-10. We had spiffy VT100-compatible terminals. But there was this odd CRT off in a corner that we referred to as "the European terminal". On it, the character code that we know and love as ASCII underscore displayed as a left arrow. I remember being disconcerted by a program that used underscore for assignment, and I was told that the language (whatever it was) assumed European terminals. More to the point, I think I remember being told that the_camel_case_naming_style was used either because it would look silly to have names like a←variable←name or because such names would be syntax errors in the Mystery Language.
I have since then assumed that this once-necessary convention stuck in people's heads after it became unnecessary or even harmful, like that pop song you loved when you were 14 or the English units of measure. (I'll spare you any pop economics about path dependence.)
(This story is similar to Wikipedia's Alto Keyboard Origin, though it would seem to put the origin closer to ASCII-63 (which had the left arrow and no underscore), ASCII-67 (which might have perpetuated the arrow), or the early ECMA standards (ditto).)
I am blissfully ignorant of Unicode.
Nevertheless, I want to write a Ruby script that puts Unicode characters (the Greek alphabet, say) onto the Mac OS X pasteboard. It has to be pure Ruby (no writing in C). 7-bit ASCII I can do, and 8-bit Mac-Roman, both using pbcopy. However, I can't see a way to do Unicode.
Please let me know if I'm wrong.
I don't care about the encoding the Ruby code works with. UTF-8, UTF-16, Punycode, whatever.
P.S. Interesting how much more understandable the Wikipedia pages on Unicode are than the official site is.
P.P.S. Seeming bug in Textedit on 10.4.3: if I create a file full of Greek characters and save it as UTF-16, I can open it and see the same characters. If I save it as UTF-8, when I reopen it, it looks like it's full of Mac-Roman characters.