CIRCServer.toLowerCase Member
Syntax
object.toLowerCase(str);
Arguments
Argument | Summary |
---|---|
str |
Returns
Remarks
See Also
Source Code
function serv_tolowercase(str)
{
/* This is an implementation that lower-cases strings according to the
* prevailing CASEMAPPING setting for the server. Values for this are:
*
* o "ascii": The ASCII characters 97 to 122 (decimal) are defined as
* the lower-case characters of ASCII 65 to 90 (decimal). No other
* character equivalency is defined.
* o "strict-rfc1459": The ASCII characters 97 to 125 (decimal) are
* defined as the lower-case characters of ASCII 65 to 93 (decimal).
* No other character equivalency is defined.
* o "rfc1459": The ASCII characters 97 to 126 (decimal) are defined as
* the lower-case characters of ASCII 65 to 94 (decimal). No other
* character equivalency is defined.
*
*/
function replaceFunction(chr)
{
return String.fromCharCode(chr.charCodeAt(0) + 32);
}
var mapping = "rfc1459";
if (this.supports)
mapping = this.supports.casemapping;
/* NOTE: There are NO breaks in this switch. This is CORRECT.
* Each mapping listed is a super-set of those below, thus we only
* transform the extra characters, and then fall through.
*/
switch (mapping)
{
case "rfc1459":
str = str.replace(/\^/g, replaceFunction);
case "strict-rfc1459":
str = str.replace(/[\[\\\]]/g, replaceFunction);
case "ascii":
str = str.replace(/[A-Z]/g, replaceFunction);
}
return str;
}