Whatever message this page gives is out now! Go check it out!

Chr

Last update:
May 18, 2026

Description

Converts a numeric value to a UCS-2 character.

Returns

A character with the specified UCS-2 character code.

Category

Function syntax

Chr(number)

See also

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>

Share this page

Was this page helpful?
We're glad. Tell us how this page helped.
We're sorry. Can you tell us what didn't work for you?
Thank you for your feedback. Your response will help improve this page.

On this page