re: remove high ASCII chars from text

2011-07-11 Thread Jason Fisher

Try this (not tested):

Text = reReplace(Text, [^\x20-\x7E], , all);



From: Matthew Friedman m...@hozgroup.com
Sent: Monday, July 11, 2011 12:48 PM
To: cf-talk cf-talk@houseoffusion.com
Subject: remove high ASCII chars from text

Is there a simple way to remove bad ascii chars form a textarea.

We are using TINYMEC as an html editor and it works great. the issue is 
when we copy from MS Word we get back chars that will not render correctly 
in HTML.

We are using and have enhanced the UDF DeMoronize to pull bad chars but we 
also want to just remove any char that is  225.
is there a way to do this other then doing a looP

for (i = 128; i LTE 160; i = i + 1)
{
Text = Replace(Text, Chr(i), , All);
}

We would want to strip anything greater then 225 and we do not want to run 
this loop up to 3000 a large waste of processing to do this.

Open to any thoughts here.
Thanks in advance - the is always great.

Matt

-- Life is to short to drink cheep beer -- 



~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:346180
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: remove high ASCII chars from text

2011-07-11 Thread Peter Boughton

Jason wrote:
Text = reReplace(Text, [^\x20-\x7E], , all);

That'll also strip tabs, newlines and carriage returns, which probably isn't 
desired.

Use [^\t\n\r\x20-\x7E] to keep them.


However, this shouldn't be necessary - doesn't TinyMCE already have the ability 
to clean-up MS Word pastes? 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:346185
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm