cf-talk  

RE: Reading Microsoft "smart" quotes with CFFILE

Robert Harrison
Tue, 08 Dec 2009 13:59:40 -0800

Replace them in a var before trying to do anything with them:
#ReplaceList(trim(YOURCONTENT), "’,…,“,” ","'',...,"","" ")#



Robert B. Harrison
Director of Interactive Services
Austin & Williams
125 Kennedy Drive, Suite 100 
Hauppauge NY 11788
P : 631.231.6600 Ext. 119 
F : 631.434.7022
http://www.austin-williams.com 

Great advertising can't be either/or.  It must be &.

Plug in to our blog: A&W Unplugged
http://www.austin-williams.com/unplugged


-----Original Message-----
From: Mosh Teitelbaum [mailto:mosh.teitelb...@evoch.com] 
Sent: Tuesday, December 08, 2009 4:11 PM
To: cf-talk
Subject: Reading Microsoft "smart" quotes with CFFILE


All:

 

I’m trying to read content from an XML file stored on disk, fiddle with it,
and save it to a database.  It all works fine except for when the content
includes smart-quotes (the XML file is a spreadsheet exported from MS Excel
to “XML Spreadsheet 2003” format).  When I use CFFILE to read the XML file,
without specifying a character set, the smart quotes get turned into 3 other
characters.  For example, an opening quote (ASC value of 8220) gets turned
into “ï¿ ½” (239-191-189).  When I specify a character set, I either get the
same results or, using “utf-8”, I get a single, unprintable character with
an ASC value of 65533, regardless of what the starting character actually
was.

 

If I enter the offending string directly into my CF code, or into a textarea
in a form, the string is read as expected.  It’s only a problem when the
string is read via CFFILE.

 

Any suggestions on what character set I should use or, barring that, another
means of reading the content from the disk?

 

TIA

 

--

Mosh Teitelbaum

evoch, LLC

http://www.evoch.com/



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:328982
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4