UTFException

Exception thrown on errors in std.utf functions.

Constructors

this
this(string msg, string file, size_t line, Throwable next)
this(string msg, size_t index, string file, size_t line, Throwable next)

Standard exception constructors.

Members

Functions

toString
string toString()

Examples

import std.exception : assertThrown;

char[4] buf;
assertThrown!UTFException(encode(buf, cast(dchar) 0xD800));
assertThrown!UTFException(encode(buf, cast(dchar) 0xDBFF));
assertThrown!UTFException(encode(buf, cast(dchar) 0xDC00));
assertThrown!UTFException(encode(buf, cast(dchar) 0xDFFF));
assertThrown!UTFException(encode(buf, cast(dchar) 0x110000));

Meta