uchar.js
No description.

File Location

/goog/i18n/uchar.js


Public Protected Private

Global Functions

goog.i18n.uChar.buildSupplementaryCodePoint(leadtrail) ?number
Composes a supplementary Unicode code point from the given UTF-16 surrogate pair. If leadSurrogate isn't a leading surrogate code point or trailSurrogate isn't a trailing surrogate code point, null is returned.
Arguments:
lead : number
The leading surrogate code point.
trail : number
The trailing surrogate code point.
Returns: ?number  The supplementary Unicode code point obtained by decoding the given UTF-16 surrogate pair.
code »
goog.i18n.uChar.charCount(codePoint) number
Determines the length of the string needed to represent the specified Unicode code point.
Arguments:
codePoint : number
No description.
Returns: number  2 if codePoint is a supplementary character, 1 otherwise.
code »
goog.i18n.uChar.createCharData()
Sets up the character map, lazily. Some characters are indexed by their decimal value.
code »
goog.i18n.uChar.fromCharCode(code) ?string
Gets a character from the given Unicode value. If the given code point is not a valid Unicode code point, null is returned.
Arguments:
code : number
The Unicode value of the character.
Returns: ?string  The character corresponding to the given Unicode value.
code »
goog.i18n.uChar.getCodePointAround(stringindex) number
Returns the Unicode code point at the specified index. If the char value specified at the given index is in the leading-surrogate range, and the following index is less than the length of string, and the char value at the following index is in the trailing-surrogate range, then the supplementary code point corresponding to this surrogate pair is returned. If the char value specified at the given index is in the trailing-surrogate range, and the preceding index is not before the start of string, and the char value at the preceding index is in the leading-surrogate range, then the negated supplementary code point corresponding to this surrogate pair is returned. The negation allows the caller to differentiate between the case where the given index is at the leading surrogate and the one where it is at the trailing surrogate, and thus deduce where the next character starts and preceding character ends. Otherwise, the char value at the given index is returned. Thus, a leading surrogate is returned when it is not followed by a trailing surrogate, and a trailing surrogate is returned when it is not preceded by a leading surrogate.
Arguments:
string : !string
The string.
index : number
The index from which the code point is to be retrieved.
Returns: number  The code point at the given index. If the given index is that of the start (i.e. lead surrogate) of a surrogate pair, returns the code point encoded by the pair. If the given index is that of the end (i.e. trail surrogate) of a surrogate pair, returns the negated code pointed encoded by the pair.
code »
goog.i18n.uChar.isLeadSurrogateCodePoint(codePoint) boolean
Gets whether the given code point is a leading surrogate character.
Arguments:
codePoint : number
No description.
Returns: boolean  Whether the given code point is a leading surrogate character.
code »
goog.i18n.uChar.isSupplementaryCodePoint(codePoint) boolean
Determines whether the specified Unicode code point is in the supplementary Unicode characters range.
Arguments:
codePoint : number
No description.
Returns: boolean  Whether then given code point is a supplementary character.
code »
goog.i18n.uChar.isTrailSurrogateCodePoint(codePoint) boolean
Gets whether the given code point is a trailing surrogate character.
Arguments:
codePoint : number
No description.
Returns: boolean  Whether the given code point is a trailing surrogate character.
code »
goog.i18n.uChar.padString_(strlengthch) string
Gets a string padded with given character to get given size.
Arguments:
str : string
The given string to be padded.
length : number
The target size of the string.
ch : string
The character to be padded with.
Returns: string  The padded string.
code »
goog.i18n.uChar.toCharCode(ch) number
Gets Unicode value of the given character.
Arguments:
ch : string
The given character, which in the case of a supplementary character is actually a surrogate pair. The remainder of the string is ignored.
Returns: number  The Unicode value of the character.
code »
goog.i18n.uChar.toHexString(ch) string
Gets the U+ notation string of a Unicode character. Ex: 'U+0041' for 'A'.
Arguments:
ch : string
The given character.
Returns: string  The U+ notation of the given character.
code »
goog.i18n.uChar.toName(ch) ?string
Gets the name of a character, if available, returns null otherwise.
Arguments:
ch : string
The character.
Returns: ?string  The name of the character.
code »

Directory i18n

File Reference