Download the PHP package mlocati/unipoints without Composer
On this page you can find all versions of the php package mlocati/unipoints. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Please rate this library. Is it a good library?
Informations about the package unipoints
A Unicode Codepoint library for PHP
Simplified Unicode Terminology
Codepoints
Codepoints are characters, spaces, symbols, punctuations, separators, ... that is, the single units that compose texts. ### Blocks Codepoints are grouped in blocks, that is, groups of contiguous codepoints that are part of a common set. Examples: - a is contained in the `Basic Latin` block - α is contained in the `Greek and Coptic` block - 𝅘𝅥𝅮 is contained in the `Musical Symbols` block - ↩ is contained in the `Arrows` block - ☂ is contained in the `Miscellaneous Symbols` block ### Planes Planes are blocks of 65,536 contiguous codepoints and may contain zero, one or many blocks. ### General Category This library also provides the general category of every codepoint, that is, you can know if a codepoint is a lowercase letter, a symbol, a punctuation, and so on. ### Surrogate Codepoints In order to extend the number of codepoints that can be represented with 16 bits, Unicode introduced "Surrogates". A single character (or punctuation, ...) can be represented by combining two consecutive surrogates (called "high surrogate" and "low surrogate"). That means that such codepoints have a meaning only in pair. ## Sample Usage Codepoints are listed in the string-backed [`MLUnipoints\Codepoint`](https://github.com/mlocati/unipoints/blob/main/src/Codepoint.php) enum. The value of the enum cases strings contain the unicode symbol: that way, for example in order to get the case of `a`, you simply can simply write: Since the `MLUnipoints\Codepoint` enum is rather big (it can use tens of MB of memory when you autoload it), you can also use the block-specific instances defined under the `MLUnipoints\Codepoint` namespace (but that requires that you already know the block in advance). For example: Every case of the `MLUnipoints\Codepoint` enum has a [`MLUnipoints\Info\CodepointInfo`](https://github.com/mlocati/unipoints/blob/main/src/Info/CategoryInfo.php) attribute. You can easily retrieve this attribute by writing This attribute provides the numeric value of the codepoint, the Unicode name, the general category, and (if you don't use the block-specific enums) the block. You can also similarly the details of the block, plane and the general category. For example, this code: will output: You can also use the Unicode enums to print out characters and symbols. For example: will print > ⛅ ## Do you really want to say thank you? You can offer me a [monthly coffee](https://github.com/sponsors/mlocati) or a [one-time coffee](https://paypal.me/mlocati) :wink:All versions of unipoints with dependencies
PHP Build Version
Package Version
Requires
php Version
^8.1
The package mlocati/unipoints contains the following files
Loading the files please wait ....