encodeCharRef

Returns a range of $(K_CHAR) containing the character reference corresponding to the given character.

encodeCharRef
(
dchar c
)

Parameters

c dchar

The character to encode.

Examples

import std.algorithm.comparison : equal;

assert(equal(encodeCharRef(' '), " "));
assert(equal(encodeCharRef('A'), "A"));
assert(equal(encodeCharRef('\u2424'), "␤"));

auto range = encodeCharRef('*');
assert(parseCharRef(range) == '*');

See Also

Meta