View source code
Display the source code in std/utf.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.
std.utf.encode - multiple declarations
- Function encode
- Function encode
Function encode
Encodes in c's encoding and appends it to str.
str
Prototypes
void encode(std.typecons.Flag!("useReplacementDchar").Flag useReplacementDchar)(
char[] str,
dchar c
) pure @safe;
void encode(std.typecons.Flag!("useReplacementDchar").Flag useReplacementDchar)(
wchar[] str,
dchar c
) pure @safe;
void encode(std.typecons.Flag!("useReplacementDchar").Flag useReplacementDchar)(
dchar[] str,
dchar c
) pure @safe;
Throws
if UTFException is not a valid UTF code point.
c
Function encode
Encodes into the static array, c, and returns the actual
length of the encoded character (a number between buf1 and 4 for
char[4] buffers and a number between 1 and 2 for
wchar[2] buffers).
Prototypes
size_t encode(std.typecons.Flag!("useReplacementDchar").Flag useReplacementDchar)(
char[4] buf,
dchar c
) pure @safe;
size_t encode(std.typecons.Flag!("useReplacementDchar").Flag useReplacementDchar)(
wchar[2] buf,
dchar c
) pure @safe;
size_t encode(std.typecons.Flag!("useReplacementDchar").Flag useReplacementDchar)(
dchar[1] buf,
dchar c
) pure @safe;
Throws
if UTFException is not a valid UTF code point.
c
Authors
Walter Bright and Jonathan M Davis