Class rehex.CharacterEncoding

A text encoding (character set).

Fields

rehex.CharacterEncoding.key The fixed identifier for the encoding (read only).
rehex.CharacterEncoding.label The display name for the encoding (read only).

Methods

rehex.CharacterEncoding:all_encodings () Get all available encodings.
rehex.CharacterEncoding:encoding_by_key (key) Get an encoding by its key.


Fields

rehex.CharacterEncoding.key
The fixed identifier for the encoding (read only).
rehex.CharacterEncoding.label
The display name for the encoding (read only).

Methods

rehex.CharacterEncoding:all_encodings ()
Get all available encodings.

**NOTE**: This is a static method/function.

Returns:

    A table of CharacterEncoding objects.

Usage:

    local encodings = rehex.CharacterEncoding.all_encodings()
    for i = 1, #encodings
    do
        print("key = " .. encodings[i].key .. ", label = " .. encodings[i].label)
    end
rehex.CharacterEncoding:encoding_by_key (key)
Get an encoding by its key.

**NOTE**: This is a static method/function.

Parameters:

  • key The key of the encoding ("ASCII", "ISO-8859-1", etc)

Returns:

    A CharacterEncoding object, or nil.

Usage:

    local ascii_encoding = rehex.CharacterEncoding.encoding_by_key("ASCII")
    if ascii_encoding ~= nil
        -- yep, ASCII still exists
    end
generated by LDoc 1.4.6 Last updated 2024-02-14 23:56:27