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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

apostrophy & carriage return

Status
Not open for further replies.

CCNProjects

Technical User
Nov 4, 2005
64
0
0
CA
Hello.

Every apostrophy like (he's) comes back from the database as a small square.
Would you mind to tell what character should replace the apostrophy in the database.

For example, to make sure the format is kept right, one should add <br> in the appropriate place in the database.

Or is there a function that would replace the apostrophies in the database by a real apostrophy on cfm page? (it sounds a little tedious)

thanks.
 
Just do a ReplaceNoCase() function on the data before you enter it in the database. Take the single apostrophy and save it as a special character.

Code:
<cfset myVar = "He's going to be going where no ever went.  She's going to be coming here any secong.  It's over there, do you get it?">

<cfoutput>
	[i]ORIGINAL:[/i] #myVar# <br/><br/>
	[i]AFTER ReplaceNoCase:[/i] #ReplaceNoCase(myVar, "'", "&##39;", "ALL")# <br/><br/>
</cfoutput>

VIEW SOURCE IN BROWSER:
[i]AFTER ReplaceNoCase:[/i] He&#39;s going to be going where no ever went.  She&#39;s going to be coming here any secong.  It&#39;s over there, do you get it? <br/><br/>

More special character conversions:
____________________________________
Just Imagine.
 
I tried many things, but to no avail!

#ReplaceNoCase(Name, char(127), "'", "ALL")#
#ReplaceNoCase(Name, "&#8217;", "'", "ALL")#

Thanks again.
 
<cfset name = Replace(Name, "‘", "'", "ALL")>
<cfset name = Replace(Name, "’", "'", "ALL")>
<cfset name = Replace(Name, "—", "&mdash;", "ALL")>
<cfset name = Replace(Name, "–", "&ndash;", "ALL")>
<cfset name = Replace(Name, "“", "#Chr(34)#", "ALL")>
<cfset name = Replace(Name, "”", "#Chr(34)#", "ALL")>

My website, or a bad habit?
BarSmart
 
thanks for your help.

nothing seems to work. I even tried:
<cfset Name = Replace(Name, "?", "’", "ALL")>

aposrophe code is 8217
? code is 127

i need to know the code for every characters that is read from the database. i think it will solve my problem.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top