The OpenD Programming Language

decompose

Returns a full Canonical (by default) or Compatibility decomposition of $(CHARACTER) ch. If no decomposition is available returns a Grapheme with the ch itself.

Note: This function also decomposes hangul syllables as prescribed by the standard.

version(!std_uni_bootstrap)
@safe
decompose
(
dchar ch
)

Examples

import std.algorithm.comparison : equal;

assert(compose('A','\u0308') == '\u00C4');
assert(compose('A', 'B') == dchar.init);
assert(compose('C', '\u0301') == '\u0106');
// note that the starter is the first one
// thus the following doesn't compose
assert(compose('\u0308', 'A') == dchar.init);

assert(decompose('Ĉ')[].equal("C\u0302"));
assert(decompose('D')[].equal("D"));
assert(decompose('\uD4DC')[].equal("\u1111\u1171\u11B7"));
assert(decompose!Compatibility('¹')[].equal("1"));

See Also

decomposeHangul for a restricted version that takes into account only hangul syllables but no other decompositions.

Meta