no real apostrophe for computers?!

This is a discussion on no real apostrophe for computers?! within the Tech Board forums, part of the Community Boards category; I'm kind of stunned I never noticed this before, but my keyboard and the ascii table does not contain a ...

  1. #1
    spurious conceit MK27's Avatar
    Join Date
    Jul 2008
    Location
    segmentation fault
    Posts
    8,300

    no real apostrophe for computers?!

    I'm kind of stunned I never noticed this before, but my keyboard and the ascii table does not contain a real apostraphe!

    The apostrophe is not supposed to be a vertical ' , what we would call the single quote. That is actually a different kind of diacritical mark. In fact, the single quote is not a real character either, single quotes should face in one of two directions, just like double quotes. Of course, I don't really care that much, so I guess it is okay.

    I noticed because I decided to substitute ' for ` in some user input to prevent SQL injection. I know there are more normative ways, since you can put a ' in an SQL db, but even after escaping it for the SQL itself, bringing it back out then creates too much hassle with JS/Ajax calls and embedded (perl) variables, which JS uses a lot of '. I imagine there the same issue exists with PHP etc, and there are some long winded ways of dealing with it.

    So I thought, hey, at least in English, all of those ' should really be `. Except that is backward:

    it is
    it's

    The apostrophe is supposed to angle back to indicate the substituted character, "i", not forward as the "backtick" (misnomer? it's a forward tick! No it's oblique ) does.

    I'm actually positive that typewriters had all four quotes, open and close single and double, AND the diacritical ' which is used in some languages but not English. Of course, I'm not sure where to look for a typewriter suddenly...but if you go a look at an old paperback, they use all forward and backward angled quotes.

    Kind of an anal issue I guess. Hopefully no one will be able to accuse me of being "wrong" by substituting ` since ' was "wrong" to start with...

    I find this a little 'trippy' for some reason.
    Last edited by MK27; 07-11-2009 at 12:07 PM.
    C programming resources:
    GNU C Function and Macro Index -- glibc reference manual
    The C Book -- nice online learner guide
    Current ISO draft standard
    CCAN -- new CPAN like open source library repository
    3 (different) GNU debugger tutorials: #1 -- #2 -- #3
    cpwiki -- our wiki on sourceforge

  2. #2
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,185
    Most paperback books weren't typeset by typewriters, but hot lead or the modern hot-lead equivalent.

    Anyway, "real" quotation marks are U201C and U201D. The "official" name for the ' character in Unicode is "apostrophe", but there are "real" single quotes at U2018 and U2019. And of course most fonts for English contains those characters somewhere -- Microsoft Word doesn't do optical tricks for smart quotes, it just replaces with the real quote characters -- although perhaps not necessarily in the Unicode code points. (I've done a little bit of font work with TeX/LaTeX, not really very much, but I know that's one of the things we set up in those fonts is the "real" quote characters.)

  3. #3
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Portugal
    Posts
    7,438
    And U2019 is the advised character for apostrophe.

    U0027 defines the apostrophe as a neutral vertical glyph. It then refers the user to U2019 for the real apostrophe glyph... which is also the right single quotation mark. It's confusing, yeah.

    It's only then a matter of finding those fonts that support U2019 on the apostrophe code. Some of these should. Look for typographical fonts particularly.

    EDIT: My keyboard does have the nice touch of correctly representing the apostrophe glyph.
    Last edited by Mario F.; 07-11-2009 at 12:49 PM.
    The programmer’s wife tells him: “Run to the store and pick up a loaf of bread. If they have eggs, get a dozen.”
    The programmer comes home with 12 loaves of bread.


    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  4. #4
    Registered User
    Join Date
    Sep 2004
    Location
    California
    Posts
    3,246
    I noticed because I decided to substitute ' for ` in some user input to prevent SQL injection.
    Slightly off-topic, but if you are attempting to prevent SQL injection, I suggest you look into using prepared statements instead of character substitution. It will save you a ton of hassle.

  5. #5
    spurious conceit MK27's Avatar
    Join Date
    Jul 2008
    Location
    segmentation fault
    Posts
    8,300
    Quote Originally Posted by bithub View Post
    Slightly off-topic, but if you are attempting to prevent SQL injection, I suggest you look into using prepared statements instead of character substitution. It will save you a ton of hassle.
    It's not putting it into the DB that is the problem, it's taking it out:

    Code:
    new Ajax.Updater($('utildiv'),'animal.comp', { method: 'post', 
                    parameters: { name: '<%$data[1]%>',
    $data[1] is an embedded perl variable returned from the database; if it is (eg) "heap's moose", this will cause a javascript error. I'm consulting with the "mason users" about this, but that is kind of a slow process. I can see one option (writing wrappers for the Updater calls) but methinks these cannot be genericized so it is kind of a hassle.
    C programming resources:
    GNU C Function and Macro Index -- glibc reference manual
    The C Book -- nice online learner guide
    Current ISO draft standard
    CCAN -- new CPAN like open source library repository
    3 (different) GNU debugger tutorials: #1 -- #2 -- #3
    cpwiki -- our wiki on sourceforge

  6. #6
    Registered User whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    7,667
    To be honest I'd rather more people learn how to use it appropriately before we worry about the ASCII keyboard.

    My mom is one of those people who pluralizes with 's, much to my chagrin.

  7. #7
    spurious conceit MK27's Avatar
    Join Date
    Jul 2008
    Location
    segmentation fault
    Posts
    8,300
    Quote Originally Posted by whiteflags View Post
    To be honest I'd rather more people learn how to use it appropriately before we worry about the ASCII keyboard.
    Well, I was an English major (and would have been an public school English teacher, but I have been a little too naughty for that now -- nb. you could not use that poster in the classroom because someone is called an "idiot").

    Anyway, my problem's solved: mason has built in routines to deal with escaping html reserved characters, but they don't include the single quote, apparently some historical reason to the effect that it's only an newer issue in xhtml, blah blah -- but there's a way to add your own escape routines:

    <%myvar|j,h%>

    h being the built-in, j being my user defined one for javascript, since mason doesn't have one. Whew! This means we are one step closer to mkBulletin! Hold on to your hats!

    I still find it pretty trippy that I hadn't noticed this computer apostrophe issue before. But as a holder of a BA in English, even I gotta say who cares...I did google around to see if some stink had ever been raised about this and was somewhat amazed to come up with nothing -- which just goes to show, some issues are so trivial *no one* can bother to argue about it.
    C programming resources:
    GNU C Function and Macro Index -- glibc reference manual
    The C Book -- nice online learner guide
    Current ISO draft standard
    CCAN -- new CPAN like open source library repository
    3 (different) GNU debugger tutorials: #1 -- #2 -- #3
    cpwiki -- our wiki on sourceforge

  8. #8
    Registered User whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    7,667
    Quote Originally Posted by MK27 View Post
    Well, I was an English major (and would have been an public school English teacher, but I have been a little too naughty for that now -- nb. you could not use that poster in the classroom because someone is called an "idiot").
    Such a bummer: I remember being subjected to a horse's ass in reference to cigarette butts and not smoking on another poster, so I really thought it would go over well.

  9. #9
    spurious conceit MK27's Avatar
    Join Date
    Jul 2008
    Location
    segmentation fault
    Posts
    8,300
    Quote Originally Posted by whiteflags View Post
    Such a bummer: I remember being subjected to a horse's ass in reference to cigarette butts and not smoking on another poster, so I really thought it would go over well.
    :[

    Probably time for one of these then.
    C programming resources:
    GNU C Function and Macro Index -- glibc reference manual
    The C Book -- nice online learner guide
    Current ISO draft standard
    CCAN -- new CPAN like open source library repository
    3 (different) GNU debugger tutorials: #1 -- #2 -- #3
    cpwiki -- our wiki on sourceforge

  10. #10
    Captain Crash brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,239
    Now we're getting into the reason I think a lot of Unicode gurus are lunatics. They assert that two glyphs which look precisely the same are in fact two different characters because of their USAGE. I think that's nuts. A character (and the set of glyphs which represent it) is a manifestation of a physical appearance, not a semantic thing.

    Over a decade of Unicode and it's STILL not adopted. I wonder why. Could it be because the folks behind it are waaaaay too anal? Hmm.
    Code:
    //try
    //{
    	if (a) do { f( b); } while(1);
    	else   do { f(!b); } while(1);
    //}

  11. #11
    Captain Crash brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,239
    Quote Originally Posted by whiteflags View Post
    My mom is one of those people who pluralizes with 's, much to my chagrin.
    Ask her where the apostrophe is supposed to go in the words: geese, mice, deer...
    Code:
    //try
    //{
    	if (a) do { f( b); } while(1);
    	else   do { f(!b); } while(1);
    //}

  12. #12
    spurious conceit MK27's Avatar
    Join Date
    Jul 2008
    Location
    segmentation fault
    Posts
    8,300
    Quote Originally Posted by brewbuck View Post
    a lot of Unicode gurus
    No! Brewbuck there cannot be anything this silly! Not after we all "decided" the apostrophe is really just a single quote!
    C programming resources:
    GNU C Function and Macro Index -- glibc reference manual
    The C Book -- nice online learner guide
    Current ISO draft standard
    CCAN -- new CPAN like open source library repository
    3 (different) GNU debugger tutorials: #1 -- #2 -- #3
    cpwiki -- our wiki on sourceforge

  13. #13
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Portugal
    Posts
    7,438
    Brewbuck, I feel you. But...

    Unicode is tasked to encode characters, not their representing glyphs. There's absolutely zero relation between Unicode code points and the glyphs they may be represented with. That is not Unicode's concern. It's up to font/application developers to decide how to represent each of the code points according to their needs (be it cultural, usage or technical).

    So, as far as character encoding is concerned, the character "single-quote" is indeed a different entity of the character "apostrophe" and they are both different code points. On some cultures or in different usage realities, both characters can be drawn differently or not. But this is not Unicode problem. It just provided the encoding to help differentiate the characters.

    I don't see how else you would like to see this happen. On this particular case it may in fact seem odd since our keyboards lack an apostrophe key. But this is no different from the dash usage in many western languages. And here I'm sure you'll admit we need different encodings for each of the three (it's three I believe, right?) dashes in the English language despite only having one on our keyboard.
    The programmer’s wife tells him: “Run to the store and pick up a loaf of bread. If they have eggs, get a dozen.”
    The programmer comes home with 12 loaves of bread.


    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  14. #14
    spurious conceit MK27's Avatar
    Join Date
    Jul 2008
    Location
    segmentation fault
    Posts
    8,300
    Quote Originally Posted by Mario F. View Post
    I don't see how else you would like to see this happen. On this particular case it may in fact seem odd since our keyboards lack an apostrophe key. But this is no different from the dash usage in many western languages. And here I'm sure you'll admit we need different encodings for each of the three (it's three I believe, right?) dashes in the English language despite only having one on our keyboard.
    Looks to me like there are really only two, unless you count the 3 em "omission" dash:
    The Dash

    Since there doesn't seem to have been any squealing from the academy, maybe now is the time we are all ready to move on and call this ' evolution. Of course, I'm one of those people who, when wielding a pen, has used all capital letters since about grade 7.
    C programming resources:
    GNU C Function and Macro Index -- glibc reference manual
    The C Book -- nice online learner guide
    Current ISO draft standard
    CCAN -- new CPAN like open source library repository
    3 (different) GNU debugger tutorials: #1 -- #2 -- #3
    cpwiki -- our wiki on sourceforge

  15. #15
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Portugal
    Posts
    7,438
    Yeah, I'm counting the hyphen there. So three "dashes". Should probably also include the minus sign.
    The programmer’s wife tells him: “Run to the store and pick up a loaf of bread. If they have eggs, get a dozen.”
    The programmer comes home with 12 loaves of bread.


    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

Page 1 of 2 12 LastLast
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Factorial
    By foxman in forum Contests Board
    Replies: 27
    Last Post: 07-11-2008, 06:59 PM
  2. %16 with double
    By spank in forum C Programming
    Replies: 11
    Last Post: 03-05-2006, 09:10 PM
  3. Why am I getting 'undelcared identifier' ???
    By Bill83 in forum C++ Programming
    Replies: 2
    Last Post: 02-15-2006, 12:00 PM
  4. Programming Puns
    By kermi3 in forum A Brief History of Cprogramming.com
    Replies: 44
    Last Post: 03-23-2002, 03:38 PM
  5. Replies: 7
    Last Post: 12-12-2001, 09:28 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21