Title: RE: [CFTALKTor] Freaking Quotations
Charles' custom tag CF_TEXTAREAFORMAT available at http://www.systemanage.com/cff/cf_textareaformat.cfm
 
Does a lot of the Replace() stuff that would avoid many common problems with outputting user-inserted data... also you can easily edit it to replace any other "funny characters" you may encounter.
 
Hope that helps.
 
Bill.
----- Original Message -----
Sent: Wednesday, July 10, 2002 1:23 PM
Subject: Re: RE: RE: [CFTALKTor] Freaking Quotations

ahh, okay...
 
i'm not sure where i need to begin...  are you planning to change the data in the database or simply change it whenever you display the data.
 
In any case, you don't need to "loop through a block of text".  If the text is assigned to a string variable, you can use the string function Replace.  This and other string functins can be found in your CF documentation; you may want to browse to see what meets your needs; probably Replace() in this case
 
If the text is assigned to a string myTextString:
 
newTextString = Replace(myTextString, <badchar>, <quotechar>);
 
As rudy said, maybe you can have <badchar> be Chr(146)
and <quotechar> is Chr(39)
 
Or, else, badchar could be "&"(where & is an exact copy-paste of the funny character), and quotechar may be """"  (because you need to escape quotation marks in CF??) 
(I can't tell you exactly because i'd have to experiment with some dummy strings first to see what works--so you can experiment and see what works.)
 
Maybe somebody else would know how/if you can use REReplace (regular expression replace).
 
I can look it at more this evening if you need more help.

crc

----- Original Message -----
From: Jeremy Oudit
Sent: 7/10/2002 11:49:56 AM
To: [EMAIL PROTECTED]
Subject: RE: RE: [CFTALKTor] Freaking Quotations

Thanks Carina,
That explains why it happened. as to the fix...

This may seem a little newbieish but how would you loop through a block of text to find special characters? Once you've found them, how would you replace them? Are there any examples or tutorials out there of routines that will do that?
-----Original Message-----
From: [mailto:[EMAIL PROTECTED]]
Sent: July 10, 2002 8:31 AM
To: [EMAIL PROTECTED]
Subject: Re: RE: [CFTALKTor] Freaking Quotations

did it go from ASP on NT to CF on unix/linux or something like that?

I know when I switch platforms, the special characters from word, for example, get messed up in different programs, and do appear as "boxes." Most annoying are word characters such as "curly quotes", en-dashes, etc., as well as foreign language characters (e-accent-aigue, etc.)

If you want the database cleaned up, you may have to write a little CF database routine that will loop through ALL the text fields in your database and replace the "box" character (copy-paste it) and with the appropriate html-safe character (quote, etc.)

Or, if you can (or want to) keep the database as is, you can write a little routine that goes between your database pull and your display to do the same thing: find any funny characters and replace them with their corresponding normal character.

hope that helps.
carina

----- Original Message -----
From: Jeremy Oudit
Sent: 7/10/2002 10:37:20 AM
To: [EMAIL PROTECTED]
Subject: RE: [CFTALKTor] Freaking Quotations

love to post the ASP but it's 54 pages worth of spaghetti code in one document. here is the CF




#text#


#text#


#paragraphformat(text)#




  • #list#


#listLast(text,";")#


#listLast(text,";")#


#text#

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: July 10, 2002 7:27 AM
To: [EMAIL PROTECTED]
Subject: re: [CFTALKTor] Freaking Quotations


post both the asp and the cf code..



Dave Seddon (p) 997-1803
Internet Software Support Specialist
Workplace Information Directorate, HRDC-DRHC
e-mail: [EMAIL PROTECTED]
Web: http://labour.hrdc-drhc.gc.ca

---------- Original Text ----------

From: "Jeremy Oudit" , on 2002-07-10 10:22 AM:

I'm in the process of redoing a website that was previously made in ASP into
Cold fusion. Things are progressing really smoothly. EXCEPT FOR THIS:
Anything content that is pulled from the database displays quotations or
apostrophes as a box. WHY FOR THE LOVE OF GOD WHY???? This drives me nuts.
Quotes display fine in the ASP version and I haven't changed any of the
content in the data base itself. Any ideas. Why does CF do this?


-
You are subscribed to the CFUGToronto CFTALK ListSRV.
This message has been posted by: [EMAIL PROTECTED]
To Unsubscribe, Please Visit and Login to http://www.CFUGToronto.org/
Manager: Kevin Towes ([EMAIL PROTECTED]) http://www.CFUGToronto.org/
This System has been donated by Infopreneur, Inc.
(http://www.infopreneur.net)

Reply via email to