digitalmars.D.bugs - RFE - trivial utf/char macros
- =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= (19/19) Oct 28 2004 Just an addition to the "isValidDchar" function :
Just an addition to the "isValidDchar" function : --- utf.d.orig Wed Sep 29 04:25:49 2004 +++ utf.d Thu Oct 28 00:01:50 2004 -40,6 +40,15 } } +bit isAscii(char c) +{ + return c <= 0x7F; +} + +bit isSurrogate(wchar c) +{ + return (c >= 0xD800 && c <= 0xDFFF); +} bit isValidDchar(dchar c) { Perhaps obvious to all Unicode experts, but anyway... --anders
Oct 28 2004