Replacing Apostrophes in Classic ASP
Posted on 2010-11-17
I have a function that replaces apostrophes with ~ or ~~ for my datbase insertion; however, whenever something is pasted into the textbox from office, the apostrophe takes on a different character.
' is what I have programmed for; however, ’ is what is created via office (straight vs curly).
I tried the following code but it does not recognize the curly apostrophes:
strData = Replace(strData, "'", "~")
strData = Replace(strData, "’", "~")
strData = Replace(strData, """", "~~")
strData = Replace(strData, "“", "~~")
ReplaceQuotesSave = Trim(strData)
It works great on the straight apostrophe (').
Anyone know how to deal with the curly apostrophes in asp?