title: Use gsub to replace curly apostrophe with straight apostrophe in R list of character vectors
body: <p>Looking for some guidance on how to replace a curly apostrophe with a straight apostrophe in an R list of character vectors.  </p>
  
  <p>The reason I'm replacing the curly apostrophes - later in the script, I check each list item, to see if it's found in a dictionary (using qdapDictionary) to ensure it's a real word and not garbage.  The dictionary uses straight apostrophes, so words with the curly apostrophes are being "rejected." </p>
  
  <p>A sample of the code I have currently follows.  In my test list, item #6 contains a curly apostrophe, and item #2 has a straight apostrophe.</p>
  
  <p>Example:</p>
  
  <pre><code>list_TestWords &lt;- as.list(c("this", "isn't", "ideal", "but", "we", "can’t", "fix", "it"))
  
  func_ReplaceTypographicApostrophes &lt;- function(x) {
     gsub("’", "'", x, ignore.case = TRUE)
   }
  
  list_TestWords_Fixed &lt;- lapply(list_TestWords, func_ReplaceTypographicApostrophes)
  </code></pre>
  
  <p>The result:  No change.  Item 6 still using curly apostrophe.  See output below.</p>
  
  <pre><code>list_TestWords_Fixed
  [[1]]
  [1] "this"
  
  [[2]]
  [1] "isn't"
  
  [[3]]
  [1] "ideal"
  
  [[4]]
  [1] "but"
  
  [[5]]
  [1] "we"
  
  [[6]]
  [1] "can’t"
  
  [[7]]
  [1] "fix"
  
  [[8]]
  [1] "it"
  </code></pre>
  
  <p>Any help you can offer will be most appreciated!</p>