View source code Display the source code in std/uni.d from which this page was generated on github. Improve this page Quickly fork, edit online, and submit a pull request for this page. Requires a signed-in GitHub account. This works well for small changes. If you'd like to make larger changes you may want to consider using local clone. Page wiki View or edit the community-maintained wiki page associated with this page.

Function std.uni.decompose

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

Prototype

Grapheme decompose(std.uni.UnicodeDecomposition decompType)(
  dchar ch
);

Note

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

See Also

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

Example

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

Authors

Dmitry Olshansky

License

Boost License 1.0.

Comments