Code Comments
Programming Forum and web based access to our favorite programming groups.how to print apostrophe character ' and double quote " in asp using vbscript. my code using response.write replaces " character with inverted question mark. please help
Post Follow-up to this messagehow to print apostrophe character ' and double quote " in asp using vbscript. my code using response.write replaces " character with question mark. please help
Post Follow-up to this messagehow to print apostrophe character ' and double quote " in asp using vbscript. my code using response.write replaces " character with inverted question mark. please help
Post Follow-up to this message'*************************************** *************************** Function DataPrep(strText) ' 'PURPOSE: prep data text entry ' 'PARAMETERS: strText -- text string to modify '*************************************** *************************** If NOT isNull(strText) then DataPrep = Replace(strText, ";", "") DataPrep = Replace(DataPrep, "'", "'") DataPrep = Replace(DataPrep, """", """) DataPrep = Replace(DataPrep, "<", "<") DataPrep = Replace(DataPrep, ">", ">") End if End Function "S N" <uandme72@yahoo.com> wrote in message news:OCmJVc5hIHA.4076@TK2MSFTNGP05.phx.gbl...[c olor=darkred] > how to print apostrophe character ' and double quote " in asp using vbscri pt. > my code using response.write replaces " character with inverted question m ark. > please help > >[/color]
Post Follow-up to this messageJon Paal [MSMD] wrote: > '*************************************** *************************** > Function DataPrep(strText) > ' > 'PURPOSE: prep data text entry > ' > 'PARAMETERS: strText -- text string to modify > '*************************************** *************************** > If NOT isNull(strText) then > > DataPrep = Replace(strText, ";", "") > DataPrep = Replace(DataPrep, "'", "'") > DataPrep = Replace(DataPrep, """", """) > DataPrep = Replace(DataPrep, "<", "<") > DataPrep = Replace(DataPrep, ">", ">") > > End if > > End Function > ?? What's wrong with Response.Write Server.HTMLEncode(strText) -- Microsoft MVP - ASP/ASP.NET Please reply to the newsgroup. This email account is my spam trap so I don't check it very often. If you must reply off-line, then remove the "NO SPAM"
Post Follow-up to this message"Dataprep" type function allows for customization, otherwise nothing wrong w ith your suggested solution...
Post Follow-up to this messageJon Paal [MSMD] wrote on 17 mrt 2008 in microsoft.public.inetserver.asp.general: > "Dataprep" type function allows for customization, otherwise nothing > wrong with your suggested solution... whose? -- Evertjan. The Netherlands. (Please change the x'es to dots in my emailaddress)
Post Follow-up to this messagewhere to get the values of constants like &apos and " also i want to replace single " and not double "" please advise "Jon Paal [MSMD]" <Jon nospam Paal @ everywhere dot com> wrote in message news:13tqv4u4qegn7c8@corp.supernews.com... > '*************************************** *************************** > Function DataPrep(strText) > ' > 'PURPOSE: prep data text entry > ' > 'PARAMETERS: strText -- text string to modify > '*************************************** *************************** > If NOT isNull(strText) then > > DataPrep = Replace(strText, ";", "") > DataPrep = Replace(DataPrep, "'", "'") > DataPrep = Replace(DataPrep, """", """) > DataPrep = Replace(DataPrep, "<", "<") > DataPrep = Replace(DataPrep, ">", ">") > > End if > > End Function > > > > > "S N" <uandme72@yahoo.com> wrote in message > news:OCmJVc5hIHA.4076@TK2MSFTNGP05.phx.gbl... > >
Post Follow-up to this message' and " are HTML entities - these are converted by web browsers into ' and " respectively. If you just want to print the literal characters, that's easy enough: Response.Write """" will print a single " (there are 4 " in that line, the two outer ones are the string containers, the two inners generate the single " as doubling them up inside a string turns them into a literal instead). another example Response.Write "<a href=""http://myurl.com/apage.asp"">This is a link</a>" Notice how you just double up the quotation marks. For an apostrophe you don't need to do anything special: Response.Write "They're not here" So what problem are you having with quotes and apostrophes? Dan msnews wrote on Mon, 17 Mar 2008 15:05:23 +0530: > where to get the values of constants like &apos and " also i want > to replace single " and not double "" > please advise > "Jon Paal [MSMD]" <Jon nospam Paal @ everywhere dot com> wrote in > message news:13tqv4u4qegn7c8@corp.supernews.com...
Post Follow-up to this messageDaniel Crichton wrote: > ' and " are HTML entities - these are converted by web > browsers into ' and " respectively. > > If you just want to print the literal characters, that's easy enough: > > Response.Write """" > > will print a single " (there are 4 " in that line, the two outer ones > are the string containers, the two inners generate the single " as > doubling them up inside a string turns them into a literal instead). > > another example > > Response.Write "<a href=""http://myurl.com/apage.asp"">This is a > link</a>" > Notice how you just double up the quotation marks. > > For an apostrophe you don't need to do anything special: > > Response.Write "They're not here" > > So what problem are you having with quotes and apostrophes? > From the original post: "my code using response.write replaces " character with question mark" It's most likely a codepage problem. I've been holding back from replying to this because Anthony typically has the most reliable advice for these situations. -- Microsoft MVP - ASP/ASP.NET Please reply to the newsgroup. This email account is my spam trap so I don't check it very often. If you must reply off-line, then remove the "NO SPAM"
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.