0
|
1 module dmd.Utf;
|
|
2
|
|
3 import dmd.Dchar;
|
|
4
|
|
5 import std.utf;
|
|
6
|
|
7 string utf_decodeChar(const(char)[] s, size_t* pidx, dchar* presult)
|
|
8 {
|
|
9 try {
|
|
10 *presult = decode(s, *pidx);
|
|
11 } catch (Exception e) {
|
|
12 return e.toString();
|
|
13 }
|
|
14
|
|
15 return null;
|
|
16 }
|
|
17
|
|
18 string utf_decodeWchar(const(wchar)[] s, size_t* pidx, dchar* presult)
|
|
19 {
|
|
20 assert(false);
|
|
21 }
|
|
22
|
|
23 bool utf_isValidDchar(uint c)
|
|
24 {
|
|
25 return isValidDchar(c);
|
|
26 }
|
|
27
|
|
28 extern (C++) extern int HtmlNamedEntity(ubyte* p, int length); |