Description

Converts a numeric value to a UCS-2 character.

Returns

A character with the specified UCS-2 character code.

Category

String functions

Function syntax

Chr(number)

See also

Asc

History

ColdFusion MX: Changed Unicode support: ColdFusion supports the Java UCS-2 representation of Unicode characters, up to a value of 65535. (Earlier releases supported 1-255.)

Parameters

Parameter

Description

number

A value (a number in the range 0 - 65535, inclusive)

Usage

The values 0 - 31 are standard, nonprintable codes. For example:

  • Chr(10) returns a linefeed character
  • Chr(13) returns a carriage return character
  • The two-character string Chr(13) & Chr(10)returns a Windows newline

    Note: For a complete list of the Unicode characters and their codes, see www.unicode.org/charts/

Example

<cfscript>
    x = chr(0500); 
    writeOutput('character: #x#'); 
    x = asc(x); 
    writeOutput('<br>Unicode value: #x#');
</cfscript>

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License  Twitter™ and Facebook posts are not covered under the terms of Creative Commons.

Legal Notices   |   Online Privacy Policy