Rules / Types, classes & roles / composite

Uni Reference

A string of Unicode codepoints

What it is #

Position in the hierarchy #

Inherits from
Does
Inherited byNFD, NFC, NFKD, NFKC

Routines #

Signatures are reproduced from the documentation, including their declared return types. A routine listed here is part of the type's published interface; whether Raku++ implements it is a separate question, answered by the examples below.

method new #

method new(*@codes --> Uni:D)

Returns Uni:D.

Creates a new Uni instance from the given codepoint numbers.

method list #

method list(Uni:D:)

Returns a Seq of integer codepoints.

method NFC #

method NFC(Uni:D: --> NFC:D)

Returns NFC:D.

Returns an NFC (Normal Form Composed)-converted version of the invocant.

method NFD #

method NFD(Uni:D: --> NFD:D)

Returns NFD:D.

Returns an NFD (Normal Form Decomposed)-converted version of the invocant.

method NFKC #

method NFKC(Uni:D: --> NFKC:D)

Returns NFKC:D.

Returns an NFKC (Normal Form Compatibility Composed)-converted version of the invocant.

method NFKD #

method NFKD(Uni:D: --> NFKD:D)

Returns NFKD:D.

Returns an NFKD (Normal Form Compatibility Decomposed)-converted version of the invocant.

method codes #

method codes(Uni:D: --> Int:D)

Returns Int:D.

Returns the number of codepoints in the invocant.

method elems #

method elems(Uni:D: --> Int:D)

Returns Int:D.

Returns the number of codepoints in the invocant.

Examples, run three ways #

Every example below comes from the official documentation, together with the output that documentation asserts. Each was then executed by Rakudo and by Raku++ when this page was built. Where the three agree, one result is shown; where they do not, all three are — because which of them is wrong is exactly the information worth having.

1 no-output

class Uni does Positional[uint32] does Stringy { }

Not executed: the documentation states no expected output for this example.