I am trying to replace a series of characters with an html encoded string value and use that to look for a value in a table. My problem is that when I put the encoded value in the replace function, cf converts it to the character instead of leaving it as those characters. Example Let say Passname = "%E2%84%A2Hello" I have the code: <cfset PassName=#Replace(PassName, "%E2%84%A2", "&##153;","all")#> this will make the string passname contain: "â„¢Hello". I want it to be "&##153;Hello" (remove the extra # for the correct result) Is there any way to do this? Thanks Simmy
my guess is that the PassName variable actually does contain "&##153;Hello" but when you're outputting it is getting changed to the evaluated version of &##153;+Hello if what you're looking to do is simply output the variable you could probably do something like this wherever it is outputted <cfoutput>#replace(PassName,"&", "&#</cfoutput>
whoops something i did in that last line turned into a smiley face.. here it is again <cfoutput>#replace(PassName,"&", "&", "all")#</cfoutput> Code (markup):