Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Ignore special characters

Guest
Aug 31, 2010 Aug 31, 2010

I started working on a website that pulls information from another websites database. The issue I have is the users are entering in content which breaks the whole site. There are so many users that I can't tell them all to avoid special characters. Is there any to tell ColdFusion to ingore special characters, or to read the information as just text.

628
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Aug 31, 2010 Aug 31, 2010

This situation is what the various "format" functions are for.  HTMLEditFormat(), HTMLCodeFormat(), urlEncodedFormat(), XMLFormat() etc.  Use the appropiate one(s) for your needs.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Aug 31, 2010 Aug 31, 2010

In addition to using the functions ilssac mentioned you might search the user defined functions posted at http://www.cflib.org/ .

You will find functions for:

1. Removing HTML: http://www.cflib.org/udf/stripHTML

2. Converting Microsoft Word smart quote characters to standard quotes: http://www.cflib.org/udf/ConvertSpecialChars

It might be helpful to know what you mean by "special characters".

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Aug 31, 2010 Aug 31, 2010

I am not entirely sure what actually broke the web page. What is being entered are just comments, nothing complicated. One post will break the web page and if you remove all quotes and punctuation that same post will work no problem.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Aug 31, 2010 Aug 31, 2010
LATEST

If the text is being copied from Microsoft Word the problem might be that single and double quotes in Word (AKA 'smart quotes') are not standard ASCII characters. You should be able to find a function at cflib.org that can find and replace these characters.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources