goog.i18n.uChar
Functions
buildSupplementaryCodePoint( lead, trail ) → (number|null)
(number|null)
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.
Parameters |
| ||||||||
---|---|---|---|---|---|---|---|---|---|
Returns |
|
charCount( codePoint ) → number
number
fromCharCode( code ) → (string|null)
(string|null)
getCodePointAround( string, index ) → number
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.
Parameters |
| ||||||||
---|---|---|---|---|---|---|---|---|---|
Returns |
|
isLeadSurrogateCodePoint( codePoint ) → boolean
boolean
isSupplementaryCodePoint( codePoint ) → boolean
boolean
isTrailSurrogateCodePoint( codePoint ) → boolean
boolean
toCharCode( ch ) → number
number
toHexString( ch ) → string
string