Mercurial > projects > ddmd
annotate dmd/Utf.d @ 192:eb38fdcb3e62 default tip
updated to compile with dmd2.062
author | korDen |
---|---|
date | Sat, 02 Mar 2013 01:25:52 -0800 |
parents | e28b18c23469 |
children |
rev | line source |
---|---|
0 | 1 module dmd.Utf; |
2 | |
114 | 3 import dmd.common; |
0 | 4 import dmd.Dchar; |
5 | |
6 import std.utf; | |
7 | |
8 string utf_decodeChar(const(char)[] s, size_t* pidx, dchar* presult) | |
9 { | |
10 try { | |
11 *presult = decode(s, *pidx); | |
12 } catch (Exception e) { | |
13 return e.toString(); | |
14 } | |
15 | |
16 return null; | |
17 } | |
18 | |
19 string utf_decodeWchar(const(wchar)[] s, size_t* pidx, dchar* presult) | |
20 { | |
20
1628b221808d
Fleshed out more unimplemented methods.
Robert Clipsham <robert@octarineparrot.com>
parents:
0
diff
changeset
|
21 try { |
1628b221808d
Fleshed out more unimplemented methods.
Robert Clipsham <robert@octarineparrot.com>
parents:
0
diff
changeset
|
22 *presult = decode(s, *pidx); |
1628b221808d
Fleshed out more unimplemented methods.
Robert Clipsham <robert@octarineparrot.com>
parents:
0
diff
changeset
|
23 } catch (Exception e) { |
1628b221808d
Fleshed out more unimplemented methods.
Robert Clipsham <robert@octarineparrot.com>
parents:
0
diff
changeset
|
24 return e.toString(); |
1628b221808d
Fleshed out more unimplemented methods.
Robert Clipsham <robert@octarineparrot.com>
parents:
0
diff
changeset
|
25 } |
1628b221808d
Fleshed out more unimplemented methods.
Robert Clipsham <robert@octarineparrot.com>
parents:
0
diff
changeset
|
26 |
1628b221808d
Fleshed out more unimplemented methods.
Robert Clipsham <robert@octarineparrot.com>
parents:
0
diff
changeset
|
27 return null; |
0 | 28 } |
29 | |
30 bool utf_isValidDchar(uint c) | |
31 { | |
32 return isValidDchar(c); | |
33 } | |
34 | |
20
1628b221808d
Fleshed out more unimplemented methods.
Robert Clipsham <robert@octarineparrot.com>
parents:
0
diff
changeset
|
35 extern (C++) extern int HtmlNamedEntity(ubyte* p, int length); |