Class Index | File Index

Classes


Class Charset

Create a new character set info instance. Charset instances give information about a particular character set, such as whether or not it is single byte or multibyte, and which languages commonly use that charset.

The optional options object holds extra parameters if they are necessary. The current list of supported options are:

If this copy of ilib is pre-assembled and all the data is already available, or if the data was already previously loaded, then this constructor will call the onLoad callback immediately when the initialization is done. If the onLoad option is not given, this class will only attempt to load any missing data synchronously. Depends directive: !depends charset.js
Defined in: ilib-full-dyn.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Charset(options)
Method Summary
Method Attributes Method Name and Description
 
Return a short description of the character set.
 
Return the largest number of bytes that a single character in this charset could use.
 
Return the smallest number of bytes that a single character in this charset could use.
 
Return the standard normalized name of this charset.
 
Return the original name that this instance was constructed with before it was normalized to the standard name returned by #getName.
 
Return an array of ISO script codes whose characters can be encoded with this character set.
 
Return whether or not characters larger than 1 byte use the big endian order or little endian.
 
Return true if this is a multibyte character set, or false for a fixed width character set.
Class Detail
Charset(options)
Parameters:
{Object=} options
options which govern the construction of this instance
See:
for information about registering a loader callback instance
Method Detail
{string} getDescription()
Return a short description of the character set.
Returns:
{string} a description of the character set

{number} getMaxCharWidth()
Return the largest number of bytes that a single character in this charset could use.
Returns:
{number} the largest number of bytes that a single character in this charset uses

{number} getMinCharWidth()
Return the smallest number of bytes that a single character in this charset could use. For most charsets, this is 1, but for some charsets such as Unicode encoded in UTF-16, this may be 2 or more.
Returns:
{number} the smallest number of bytes that a single character in this charset uses

{string} getName()
Return the standard normalized name of this charset. The list of standard names comes from the IANA registry of character set names at http://www.iana.org/assignments/character-sets/character-sets.xhtml.
Returns:
{string} the name of the charset

{String} getOriginalName()
Return the original name that this instance was constructed with before it was normalized to the standard name returned by #getName.
Returns:
{String} the original name that this instance was constructed with

{Array.<string>} getScripts()
Return an array of ISO script codes whose characters can be encoded with this character set.
Returns:
{Array.<string>} an array of ISO script codes supported by this charset

{boolean} isBigEndian()
Return whether or not characters larger than 1 byte use the big endian order or little endian.
Returns:
{boolean} true if this character set uses big endian order, or false otherwise

{boolean} isMultibyte()
Return true if this is a multibyte character set, or false for a fixed width character set. A multibyte character set is one in which the characters have a variable width. That is, one character may use 1 byte and a different character might use 2 or 3 bytes.
Returns:
{boolean} true if this is a multibyte charset, or false otherwise

Documentation generated by JsDoc Toolkit 2.4.0 on Mon Oct 21 2019 22:58:32 GMT-0700 (PDT)