Aleks
asked on
Replacing smart quotes from word
We currently have a function to cleanup a string of XML data, so far its been working great, but a couple of clients are copy/pasting their text from word, and word has 'smart quotes' which seem to be different than regular quotes. How can I add code to the function so that it converts those quotes into ' just like it does with regular quotes ?
function clean( str )
if str <> "" and not isNull( str ) then
str = Replace( str, "<", "" )
str = Replace( str, ">", "" )
str = Replace( str, "&", "&" )
str = Replace( str, "'", "'" )
str = Replace( str, """, "\""" )
str = Replace( str, "&apos;", "'" )
end if
clean = str
end function
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Cool !
as far as I know, those are the ones that'll give you problems.
as for your other question, can't use the same function to "clean" values before you do an insert?
as for your other question, can't use the same function to "clean" values before you do an insert?
ASKER
I think we can. I added it to my include files, but how do I apply it to the insert statement above ?
Do I need to add it to each field ?
MM_editCmd.Parameters.Appe nd MM_editCmd.CreateParameter ("param13" , 201, 1, -1, Request.Form("JobDesc")) ' adLongVarChar
If so, what would the syntax be for the above line ?
I already have the function in my include files.
Do I need to add it to each field ?
MM_editCmd.Parameters.Appe
If so, what would the syntax be for the above line ?
I already have the function in my include files.
i answered in the other question
ASKER
Thanks!
ASKER