Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Find and Replace "TM" junk character... HELP!

Status
Not open for further replies.

rockyroad

Programmer
Feb 22, 2003
191
US
Hi,
I am building an RSS feed from DB query in CF.I have all my replace statements for junk chars working... except for the "TM" symbol. I can't seem to even get my replace statements to FIND the thing in order to replace it... I have all these...
Code:
<cfset description = #replace(description, #ASC("0x2122")#, "&##8482;", "ALL")#>
<cfset description = #replace(description, "™", "&##8482;", "ALL")#>
<cfset description = #replace(description, "&##153;", "&##8482;", "ALL")#>
<cfset description = #replace(description, "â„¢", "&##8482;", "ALL")#>
None of which can even see the junk char... in the DB I see it's in there as literally a little "TM" character. Any advice would be fantastic.

Thanks, RR
 
RR

I'm gonna guess that it is some sort of weird MS Word special character. What I've done in the past is to loop over the content, and output the character and then the asc() or chr() version (I can never remember which on to use) of the character, and see what that is.

the code should be something like this:

Code:
<cfoutput>
  <cfloop from="1" to="#Len(YourString)#" index="i">
    The character #Mid(YourString, 1, i)# is #Asc(Mid(YourString, 1, i))# in asc and #Chr(Mid(YourString, 1, i))# in chr<br />
  </cfloop>
</cfoutput>

If that doesn't work can you post the url to the RSS?

Hope this helps!

Tony
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top