|
Mailing Lists
|
Home /
Groups /
ColdFusion Talk (CF-Talk)
Handling MS Word "Smart" Quotes
Author: Stephen Moretti
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:23492#118204
Somthing you might find of interest....
http://www.tazmedia.co.uk/software/tags/try_CleanMSText.cfm
Stephen
----- Excess quoted text cut - see Original Post for more -----
Author: Ryan Mitchell
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:23492#118088
Strange, I copied the text from your email and it worked... I guess it
displayed wrong in my browser...
Thanks Mosh.
Ryan
On 29/4/03 7:48 pm, "Mosh Teitelbaum" <mosh.teitelbaum@evoch.com> wrote:
> ReplaceList(textin, "#chr(145)#,#chr(146)#,#chr(147)#,#chr(148)#",
> "',',"",""")
Author: Mosh Teitelbaum
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:23492#118087
Well, the code for the UDF is pretty straight forward:
ReplaceList(textin, "#chr(145)#,#chr(146)#,#chr(147)#,#chr(148)#",
"',',"",""")
What sort of problems is it causing you in CFMX?
--
Mosh Teitelbaum
evoch, LLC
Tel: (301) 942-5378
Fax: (301) 933-3651
Email: mosh.teitelbaum@evoch.com
WWW: http://www.evoch.com/
----- Excess quoted text cut - see Original Post for more -----
Author: Snyder, Scott, A&M IRM
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:23492#118086
replace them with their decimal equivalents before inserting them into the
DB. I think they are “ and ”
I was looking for something similar myself, but I couldn¹t get this script
to work in MX, any thoughts?
On 29/4/03 4:10 pm, "Mosh Teitelbaum" <mosh.teitelbaum@evoch.com> wrote:
> Check out the ConvertSpecialChars() UDF at:
> http://www.cflib.org/udf.cfm?ID=319
>
> You can use it to replace the MS Word characters or convert its logic to
SQL
----- Excess quoted text cut - see Original Post for more -----
Author: Barney Boisvert
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:23492#118085
Those characters are ASCII 145-148 (two quotes, two double quotes). You can
easily do a search and replace on them to replace them with the proper
codes. Of course, you'll have to make sure your pulling data out of the DB
in the right character set for this to work, and that's the tricky part.
Best to do it on the insertion side, before inserting it into the database.
barneyb
---
Barney Boisvert, Senior Development Engineer
AudienceCentral (formerly PIER System, Inc.)
bboisvert@audiencecentral.com
voice : 360.756.8080 x12
fax : 360.647.5351
www.audiencecentral.com
----- Excess quoted text cut - see Original Post for more -----
Author: Ryan Mitchell
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:23492#118080
I was looking for something similar myself, but I couldn¹t get this script
to work in MX, any thoughts?
On 29/4/03 4:10 pm, "Mosh Teitelbaum" <mosh.teitelbaum@evoch.com> wrote:
----- Excess quoted text cut - see Original Post for more -----
Author: E. Keith Dodd
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:23492#118050
In the app I have, people can copy/paste directly into textarea. I have a
tag for the various chr's, but found I had to include replacing the actual
characters before inserting into database table field. This took care of all
the smart quotes. The MSRubbish is the original entry. (Adapted from Chris
Tazewell's CleanMSText custom tag)
(Don't know whether the actual curly stuff will show in this posted email.)
MSRubbish = Replace(MSRubbish, '"', '"', 'all');
MSRubbish = Replace(MSRubbish, '"', '"', 'all');
MSRubbish = Replace(MSRubbish, "'", "'", 'all');
MSRubbish = Replace(MSRubbish, "'", "'", 'all');
E. Keith Dodd
Wings of Eagles Services
www.wingserv.com
> I've got an simple content management application where users cut and
paste
> text from MS word into form fields that are then inserted into a MS SQL
2000
> database. Subsequently this text is pulled out of the database and
> displayed in HTML pages to other users. Pretty standard stuff.
>
> The trouble I'm having is with MS Word's smart quotes, those fancy single
> and double quote marks that are curved. When these are cut and pasted
into
> the form and then pulled out to display, the HTML does not recognize the
> characters and display's small boxes. Is there a simple way to scrub my
> database of these smart-aleck marks and replace them with their
> straight-laced cousins and/or format my HTML so that it understands the
> smarty pants curvy ones?
>
> I'm hoping for a simple automated solution that I can apply globally so
that
> the poor content admin doesn't have to go back to the 100's of documents
to
----- Excess quoted text cut - see Original Post for more -----
Author: Mosh Teitelbaum
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:23492#118046
Check out the ConvertSpecialChars() UDF at:
http://www.cflib.org/udf.cfm?ID=319
You can use it to replace the MS Word characters or convert its logic to SQL
and apply it with an UPDATE statement.
--
Mosh Teitelbaum
evoch, LLC
Tel: (301) 942-5378
Fax: (301) 933-3651
Email: mosh.teitelbaum@evoch.com
WWW: http://www.evoch.com/
----- Excess quoted text cut - see Original Post for more -----
Author: Andre Mohamed
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:23492#118043
I believe there is a UDF on cflib.org that handles and strips Word's
smart quotes under string functions?
Check it out.
André
I've got an simple content management application where users cut and
paste
text from MS word into form fields that are then inserted into a MS SQL
2000
database. Subsequently this text is pulled out of the database and
displayed in HTML pages to other users. Pretty standard stuff.
The trouble I'm having is with MS Word's smart quotes, those fancy
single
and double quote marks that are curved. When these are cut and pasted
into
the form and then pulled out to display, the HTML does not recognize the
characters and display's small boxes. Is there a simple way to scrub my
database of these smart-aleck marks and replace them with their
straight-laced cousins and/or format my HTML so that it understands the
smarty pants curvy ones?
I'm hoping for a simple automated solution that I can apply globally so
that
the poor content admin doesn't have to go back to the 100's of documents
to
find and change each curvy single and double quote mark by hand.
--------------
Ian Skinner
Web Programmer
BloodSource
Sacramento, CA
Author: Dain Anderson
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:23492#118042
Hi Ian,
Here's an adaptation I made to a script I found on CFLib.org used for
converting those little buggers (it also handles the ellipsis character, the
TM character MS uses, as well as the extended hyphen):
In UDF format:
function ConvertSpecialChars(textin) {
return
ReplaceList(textin,"#Chr(8217)#,#Chr(8230)#,#Chr(8211)#,#Chr(8220)#,#Chr(822
1)#,#Chr(8482)#", "',...,--,"","",<SUP>TM</SUP>");
}
-Dain
> I've got an simple content management application where users cut and
paste
> text from MS word into form fields that are then inserted into a MS SQL
2000
> database. Subsequently this text is pulled out of the database and
> displayed in HTML pages to other users. Pretty standard stuff.
>
> The trouble I'm having is with MS Word's smart quotes, those fancy single
> and double quote marks that are curved. When these are cut and pasted
into
> the form and then pulled out to display, the HTML does not recognize the
> characters and display's small boxes. Is there a simple way to scrub my
> database of these smart-aleck marks and replace them with their
> straight-laced cousins and/or format my HTML so that it understands the
> smarty pants curvy ones?
>
> I'm hoping for a simple automated solution that I can apply globally so
that
> the poor content admin doesn't have to go back to the 100's of documents
to
----- Excess quoted text cut - see Original Post for more -----
Author: Massimo Foti
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:23492#118041
> The trouble I'm having is with MS Word's smart quotes, those fancy single
> and double quote marks that are curved. When these are cut and pasted
into
> the form and then pulled out to display, the HTML does not recognize the
> characters and display's small boxes. Is there a simple way to scrub my
> database of these smart-aleck marks and replace them with their
> straight-laced cousins and/or format my HTML so that it understands the
> smarty pants curvy ones?
Try this:
http://www.cflib.org/udf.cfm?ID=725
----------------------------
Massimo Foti
Certified Dreamweaver MX Developer
Certified Advanced ColdFusion MX Developer
http://www.massimocorner.com/
----------------------------
Author: Ian Skinner
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:23492#118040
I've got an simple content management application where users cut and paste
text from MS word into form fields that are then inserted into a MS SQL 2000
database. Subsequently this text is pulled out of the database and
displayed in HTML pages to other users. Pretty standard stuff.
The trouble I'm having is with MS Word's smart quotes, those fancy single
and double quote marks that are curved. When these are cut and pasted into
the form and then pulled out to display, the HTML does not recognize the
characters and display's small boxes. Is there a simple way to scrub my
database of these smart-aleck marks and replace them with their
straight-laced cousins and/or format my HTML so that it understands the
smarty pants curvy ones?
I'm hoping for a simple automated solution that I can apply globally so that
the poor content admin doesn't have to go back to the 100's of documents to
find and change each curvy single and double quote mark by hand.
--------------
Ian Skinner
Web Programmer
BloodSource
Sacramento, CA
|
May 24, 2012
|
Latest Fusion Authority Articles
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||