Solved

ColdFusion  Chr Encode Format

Posted on 2009-05-06
3
776 Views
Last Modified: 2013-12-24
Please tell me how to convert the following characters to the format:
Chr(x) where c is a number.

The characters are:
<, >, ', ", (, )
0
Comment
Question by:onaled777
  • 2
3 Comments
 
LVL 52

Accepted Solution

by:
_agx_ earned 500 total points
ID: 24317959
Do you mean get the ascii values?


<cfset badList = "<,>,',"",),(">

<cfoutput>

<cfloop list="#badList#" index="x">

	chr(#asc(x)#)  / result: #chr(asc(x))#<br>

</cfloop>

</cfoutput>

Open in new window

0
 
LVL 63

Expert Comment

by:Zvonko
ID: 24318091
Check this:
<cfset chars=ListToArray("<,>,',"",(,)") >

<cfloop array="#chars#" index="char" >

<cfoutput>#Asc(char)#: #char#<br></cfoutput>

</cfloop>

Open in new window

0
 
LVL 63

Expert Comment

by:Zvonko
ID: 24318097
:)
0

Featured Post

Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

Join & Write a Comment

In our day to day coding, how many times have we come across a necessity to check whether a URL is a broken link or not? For those of you that answered countless and are using ColdFusion like myself, then this article is for you.  It will show yo…
When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now