For some reason Redcarpet markdown renders '
as '
while rendering ’
as ’
. Are there two types of single quote? Why would Redcarpet treat one differently than the other. (Ascii table seems to have one, but under unicode I'm assuming there are more?)
Searching for '
and ’
is a bit difficult as well as chrome's find (command + f) and Google search seems to treat the two characters as one and the same.
Yes, there are. These two quote characters are:
hex(decimal) codepoint = 2019(8217) and character = ’
hex(decimal) codepoint = 27(39) and character = '
The code-points (first number is hex and the second is decimal values of the code-point) are distinct.
According to the Unicode standard, the first one is:
2019;RIGHT SINGLE QUOTATION MARK;Pf;0;ON;;;;;N;SINGLE COMMA QUOTATION MARK;;;;
whereas the second one is
0027;APOSTROPHE;Po;0;ON;;;;;N;APOSTROPHE-QUOTE;;;;
Perhaps RedCarpet should be using proper HTML entity escaping for the first type of quote. (This page says it should be escaped as ’
)
You are right when you say that the second quote: ' is part of 7-bit ASCII encoding.
Even if the first quote, ’
which renders as: ’ is rather indistinguishable to human eye from the second quote: ', you can search for it on Chrome or any other editor/browser using your operating system's Input Method. This is because entering a character is the job of so called Input Method and you can enter any character in the given operating system if you know the input methods it supports. For example, on the Mac:
Similar facility is available on Linux and Microsoft Windows.