CFLib.org – Common Function Library Project

jsToUnicode(str)

Last updated August 31, 2004

author

Harry Klein

Version: 1 | Requires: CF5 | Library: StrLib

Description:
Replace javascript unicode strings with unicode strings. Useful if you want to save Unicode Javascript text in WDDX files.

Return Values:
Returns a string.

Example:

<cfoutput>#jsToUnicode("\xE4")#</cfoutput>

Parameters:

Name Description Required
str String to modify. Yes

Full UDF Source:

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

Search CFLib.org


Latest Additions

Raymond Camden added
QueryDeleteRows
November 04, 2017

Leigh added
nullPad
May 11, 2016

Raymond Camden added
stripHTML
May 10, 2016

Kevin Cotton added
date2ExcelDate
May 05, 2016

Raymond Camden added
CapFirst
April 25, 2016

Created by Raymond Camden / Design by Justin Johnson