Mojibake.Block (Mojibake v0.8.0)

Copy Markdown View Source

Unicode blocks (Blocks.txt).

A block is an atom made from its name: :basic_latin for "Basic Latin", :latin_1_supplement for "Latin-1 Supplement". Mojibake.Char.block/1 returns the block of a codepoint.

Summary

Types

t()

A block, such as :basic_latin.

Functions

Every block, in codepoint order.

The name of block in Blocks.txt, or nil if block is not a block.

The codepoints of block, or nil if block is not a block.

Types

t()

@type t() :: atom()

A block, such as :basic_latin.

Functions

all()

@spec all() :: [t()]

Every block, in codepoint order.

Examples

iex> Mojibake.Block.all() |> hd()
:basic_latin

name(block)

@spec name(t()) :: String.t() | nil

The name of block in Blocks.txt, or nil if block is not a block.

Examples

iex> Mojibake.Block.name(:latin_1_supplement)
"Latin-1 Supplement"

range(block)

@spec range(t()) :: Range.t() | nil

The codepoints of block, or nil if block is not a block.

Examples

iex> Mojibake.Block.range(:basic_latin)
0..127

iex> 0x3B1 in Mojibake.Block.range(:greek_and_coptic)
true