Apostrophe vs Right Single Quotation Mark
So sánh mã hóa
| Định dạng | ' | ’ |
|---|---|---|
| Điểm mã | ||
| Thực thể HTML | ' | ’ |
| CSS | ||
| Hệ thập lục phân UTF-8 |
Sự khác biệt là gì?
The apostrophe (', U+0027) is an ASCII character that serves as both an apostrophe in contractions and possessives and as a straight single quotation mark, while the right single quotation mark (’, U+2019) is the typographically correct curly closing quote that also doubles as the preferred apostrophe in professional typography. Word processors automatically replace the typed apostrophe with U+2019 in most contexts (e.g., “don’t”), producing more polished-looking text, but this substitution breaks things in programming contexts where U+0027 is a required string delimiter. Search engines generally treat the two as equivalent for matching purposes, but string comparisons in databases and APIs are case-sensitive to code points, meaning “don’t” and “don't” are different strings at the byte level. Another related character is the modifier letter apostrophe (ʼ, U+02BC), used in linguistic transcription and in some language romanizations like Hawaiʻi or Oʼahu. When handling user-generated text, normalize all apostrophe variants to U+0027 before storage if you need reliable string matching.