0

I have a text area in my form that users generally copy-and-paste text into from their word document, as they prepare it beforehand. I am having issues with a single-quotes, but not all of them. If I am not mistaking, I do believe that its some sort of a different characters possibly from Mac side of things.

When saving to database, characters are escaped so I don't get ’ or something like that, but the quote itself is not "regular" one, it comes up as don’t instead on don't (see the different in quote?) It does not cause issues anywhere else in the code, but I do have fpdf export where that quote shows us as don’t and I don't know how to address this issue.

I would much rather "convert" the characters to regular format before they are saved, then to deal with them retroactively during fpdf export. What am I doing wrong? Thanks!

Your Common Sense
  • 156,878
  • 40
  • 214
  • 345
Pioneerx01
  • 13
  • 4
  • Where is your code? – Felippe Duarte Feb 21 '20 at 17:08
  • Sounds like an encoding problem. – Jay Blanchard Feb 21 '20 at 17:09
  • 1
    See also: [UTF-8 all the way through](//stackoverflow.com/q/279170) and [FPDF utf-8 encoding (HOW-TO)](//stackoverflow.com/q/6334134) – mario Feb 21 '20 at 17:12
  • 1
    MS frequently applies something they dubiously call "smart quotes" which convert plain `'` and `"` into the angled versions `’` and `“` which are either UTF8 or cp1252 special characters. In your case they are UTF8, so read the links @mario has posted. – Sammitch Feb 21 '20 at 17:19

0 Answers0