CFLib.org – Common Function Library Project

unicodeToJS(str)

Last updated August 31, 2004

author

Harry Klein

Version: 1 | Requires: CF5 | Library: StrLib

Description:
Replace html unicode strings with strings in javascript format. Useful if you save Javascript Strings in WDXX Files.

Return Values:
Returns a string.

Example:

<cfoutput>#unicodeToJS("&##xE4;")#</cfoutput>

Parameters:

Name Description Required
str String to modify. Yes

Full UDF Source:

/**
 * Replace html unicode strings with strings in javascript format.
 * 
 * @param str 	 String to modify. (Required)
 * @return Returns a string. 
 * @author Harry Klein (klein@contens.de) 
 * @version 1, August 31, 2004 
 */
function unicodeToJS(str){
	str = JSStringFormat(str);
	return ReReplaceNoCase(str,"&##([a-z0-9]{3});","\\1","all");
}
blog comments powered by Disqus

Search CFLib.org


Latest Additions

Kevin Cotton added
date2ExcelDate
May 5, 2016

Raymond Camden added
CapFirst
April 25, 2016

Chris Wigginton added
loremIpsum
January 18, 2016

Gary Stanton added
calculateArrival...
November 19, 2015

Sebastiaan Naafs - van Dijk added
getDaysInQuarter
November 13, 2015

Created by Raymond Camden / Design by Justin Johnson