unstd.utf

Additions to $(STDMODULE _utf).

Public Imports

std.utf
public import std.utf;

Members

Functions

adjustBack
size_t adjustBack(C[] str, size_t idx)
adjustForward
size_t adjustForward(C[] str, size_t idx)

Adjust idx to point at the start of a UTF sequence or at the end of str.

copyEncoded
To[] copyEncoded(From[] source, To[] buff)

Copies text from source to buff performing conversion to different unicode transformation format if needed.

copySomeEncoded
To[] copySomeEncoded(inout(From)[] source, To[] buff)

Copies as much text from the beginning of source to buff as latter can hold performing conversion to different unicode transformation format if needed.

isContinuationByte
bool isContinuationByte(char c)

Detect whether c is a UTF-8 continuation byte.

isLeadSurrogate
bool isLeadSurrogate(wchar c)

Detect whether c is a UTF-16 lead/trail surrogate or not a surrogate.

isSequenceStart
bool isSequenceStart(C c)

Detect whether c is the first code unit in a sequence.

isTrailSurrogate
bool isTrailSurrogate(wchar c)
isValidBMPCharacter
bool isValidBMPCharacter(wchar c)

Detect whether c is a UTF-16 lead/trail surrogate or not a surrogate.

maxLength
size_t maxLength(size_t length)
size_t maxLength(From[] str)

Returns minimum/maximum possible length of string conversion to another Unicode Transformation Format result.

minLength
size_t minLength(size_t length)
size_t minLength(From[] str)

Returns minimum/maximum possible length of string conversion to another Unicode Transformation Format result.

Meta

Authors

Denis Shelomovskij