title: Error in FUN(content(x), ...) : invalid input ' XxX std chgs to send, �1.50 to rcv' in 'utf8towcs'
body: <p>I think the tm package is great that it has so many functions that make NLP simpler to implement. However, I am new to this and I am running into a road block. Could someone help?</p>
  <pre><code>sms_clean &lt;- tm_map(sms_corpus, content_transformer(tolower))
  </code></pre>
  <p>It gave me the following error message:
  Error in FUN(content(x), ...) : invalid input 'FreeMsg Hey there darling it's been 3 week's now and no word back! I'd like some fun you up for it still? Tb ok! XxX std chgs to send, �1.50 to rcv' in 'utf8towcs'</p>
  <p>I believe there are special characters or emojis that are not UTF-8 format causing the problem. So I tried encoding when I import the file, which I found from <a href="https://stackoverflow.com/questions/63400097/error-in-chartr-invalid-input-in-utf8towcs">here</a>.</p>
  <pre><code>sms_raw &lt;- read.csv('spam.csv', 
                  encoding = 'Latin-1', 
                  stringsAsFactors = FALSE)
  </code></pre>
  <p>It gave me this error message:
  Error in FUN(content(x), ...) : invalid multibyte string 1</p>
  <p>I also tried the following that I found from another stackoverflow site:</p>
  <pre><code>usableText &lt;- str_replace_all(sms_corpus,&quot;[^[:graph:]]&quot;, &quot; &quot;) 
  </code></pre>
  <p>and
  dataset &lt;- iconv(sms_corpus, 'UTF-8', 'ASCII')
  either one helps.</p>