curly vs. straight quotes

tim_m

i'm so nice
Joined
Feb 10, 2003
Messages
5,539
ok, this kinda annoys me. it all started when i was copying faculty bios from my college's old math dept. site to the new site and i realized that most of them probably made their bios in word and emailed them to the guy in charge before me and he just copied and pasted and added html. that's fine but when i decided to use utf-8 encoding, the validator said that curly quotes that word put in were invalid. so i thought fine, just replace them all with straight quotes. no big deal but i'm wondering does it actually matter, are they just to look nice or are you supposed to use them to definitively mark the start and end of a quote so that they curl so they surround the quote?
 
Technically, you should use them (both single and double), as that's what formal English dictates. The straight quote is a typewriter-based invention.
Code:
“
is left double quote, also use right / bottom and single
 
What lomn75 suggested is probably sufficient, but if you're interested in some more typographical nitpicking, you might check out this article. It's an interesting read.
 
If you're dealing with print, it's fine to strive for typographic perfection. :)

On the web, however, there are variables, such as:

Fonts - Yes, you can specify fonts, but what if your visitor doesn't have the one you think looks best? Or sets their defaults to override page-specified fonts? Special characters can vary from font to font.

Platform - Macs and PCs use different character encoding schemes. When I was on a Mac, I'd frequently see oddball characters that were incorrect. Still do, probably something done on a Mac with "special" characters the PC doesn't recognize.

Browsers - Again, not all browsers support all characters in the same way.

Typically, news sites like CNN stick with straight quotes.
 
My thought is this: If you're striving for a print-like layout, then you should be designing for print.

That's not to say that you shouldn't do so, but I find it to be rather quixotic. To be honest, I would find that it would add a lot of unneeded cruft to my code. What's easier to read?

Code:
“This here&squo;s a double-quoted string, and
it&squo;s got some single-quotes in there,
too!&rdquot;
or
Code:
"This here's a double-quoted string, and
it's got some single-quotes in there, too!"

The second, to me, is not only easier to read, but it's easier to maintain for those of us who write code by hand. (Yes, you could use code snippets and fragment libraries and whatnot, but that's irrelevant.) Plus, it's a lot less error-prone.

I used to use the &#146 &#147 and &#148 (with the semicolons, of course) before I realized that they were out of range, and before I learned about named entities, but nowadays all I worry about are em and en dashes, since I hate the look of a double dash.
 
carl67lp said:
The second, to me, is not only easier to read, but it's easier to maintain for those of us who write code by hand. (Yes, you could use code snippets and fragment libraries and whatnot, but that's irrelevant.) Plus, it's a lot less error-prone.
I agree, but I think it's worth pointing out that any text editor worth its salt will understand the entities and hilight them in some way that makes it easier to follow the flow of the text. You could have used the HTML "tag" here instead of the CODE one, but it only italicizes the entities, I think, which doesn't help too much. I think a decent editor would also make it fairly clear if you were using an undefined entity or if you had botched the syntax.

But yes. I'm happy with plain ol' quotes unless I'm doing something for print.
 
carl67lp said:
Code:
“This here&squo;s a double-quoted string, and
   it&squo;s got some single-quotes in there,
   too!&rdquot;
My boss is a print designer that became a web designer, so even though I back the "web is not print" argument, there are times when both designers and coders can be happy. Since most of what I code is ColdFusion and database driven, I handle all of that in custom tags.

Code:
<cf_fixquotes>#txtField#</cf_fixquotes>

Now that looks clean to me. I don't have to see long blocks of content that I didn't write.

PS, I always do these types of fixes and adjustments before anything gets saved into the database. Otherwise, who knows what kind of crap people will enter into your system. You might end up learning the hard way to check for people entering "</a>" into a field that will become a link.
 
Back
Top