53
4

6 回答 6

27

I don't think that one is better than the other in general; it depends on how you intend to use it.

  • If you want to store it in a DB column that has a charset/collation that does not support the right single quote character, you may run into storing it as the multi-byte character instead of 7-bit ASCII (’).
  • If you are displaying it on an html element that specifies a charset that does not support it, it may not display in either case.
  • If many developers are going to be editing/viewing this file with editors/keyboards that do not support properly typing or displaying the character, you may want to use the entity
  • If you need to convert the file between various character encodings or formats, you may want to use the entity
  • If your HTML code may escape entities improperly, you may want to use the character.

In general I would lean more towards using the character because as you point out it is easier to read and type.

于 2013-04-02T23:54:24.677 回答
21

Typographically, the correct glyph to use in sentence punctuation is the quote mark, both single (including for apostrophes) and double quotes. The straight-looking mark that we often see on the web is called a prime, which also comes in single and double varieties and has limited uses, mostly for measurements.

This article explains how to use them correctly.

于 2013-11-20T21:47:14.090 回答
14

With ’ you know for certain that the output will be correct, no matter what.

I wish ' would output the proper apostrophe and not the typewriter apostrophe.

于 2013-08-10T22:42:49.727 回答
2

You should only use ’ if your intention is to make either a closed single quotation mark or an apostrophe. Both of these punctuation marks are curved in shape in most fonts. If your intent is to make a foot mark, go the other route. A foot mark is always a straight vertical mark.

It’s a matter of typography. One way is correct; the other is not.

于 2015-07-31T17:41:04.807 回答
1

If your text will be consumed by non-browsers then it's safer to type the character with the keyboard-combo option shift right bracket because ’ will not be transformed into an apostrophe by a regular XML or JSON parser. (e.g. if you are serving this content to native Android/iOS apps).

于 2016-04-25T13:48:47.070 回答
1

One risk of using the keyboard shortcut is that it requires using a non-ASCII encoding. That might be fine, but if your source is loaded by different editors in different locales, you might hit trouble somewhere along the line.

It might be safer to use either ’ or ’ (which are equivalent) as both are ASCII.

于 2017-09-12T13:26:27.697 回答