# `Mojibake.Script`
[🔗](https://github.com/zaerl/mojibake/blob/main/src/elixir/lib/mojibake/script.ex#L5)

Unicode scripts (UAX #24).

A script is an atom made from the long name of its `Script` property value, such as `:latin`,
`:greek`, `:han`, `:common` (characters shared by many scripts), `:inherited` (combining
marks that take the script of their base), or `:unknown` (unassigned codepoints). Three
ISO 15924 combinations used by the identifier and confusable checks come last: `:han_with_bopomofo`,
`:japanese`, and `:korean`.

`Mojibake.Char.script/1` and `Mojibake.Char.script_extensions/1` return scripts.

# `t`

```elixir
@type t() :: atom()
```

A script, such as `:latin`.

# `all`

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

Every script, in the order of the `Script` property values, then the three ISO 15924
combinations.

## Examples

    iex> :latin in Mojibake.Script.all()
    true

# `code`

```elixir
@spec code(t()) :: String.t() | nil
```

The ISO 15924 code of `script`, or `nil` if `script` is not a script.

## Examples

    iex> Mojibake.Script.code(:latin)
    "Latn"

    iex> Mojibake.Script.code(:japanese)
    "Jpan"

# `from_code`

```elixir
@spec from_code(String.t()) :: t() | nil
```

The script with the ISO 15924 code `code`, ignoring case, or `nil` if there is none.

## Examples

    iex> Mojibake.Script.from_code("Grek")
    :greek

    iex> Mojibake.Script.from_code("zyyy")
    :common

    iex> Mojibake.Script.from_code("Xxxx")
    nil

---

*Consult [api-reference.md](api-reference.md) for complete listing*
