view dmd/Utf.d @ 20:1628b221808d

Fleshed out more unimplemented methods.
author Robert Clipsham <robert@octarineparrot.com>
date Wed, 07 Apr 2010 00:29:13 +0100
parents 10317f0c89a5
children e28b18c23469
line wrap: on
line source

module dmd.Utf;

import dmd.Dchar;

import std.utf;

string utf_decodeChar(const(char)[] s, size_t* pidx, dchar* presult)
{
	try {
		*presult = decode(s, *pidx);
	} catch (Exception e) {
		return e.toString();
	}

	return null;
}

string utf_decodeWchar(const(wchar)[] s, size_t* pidx, dchar* presult)
{
	try {
		*presult = decode(s, *pidx);
	} catch (Exception e) {
		return e.toString();
	}

	return null;
}

bool utf_isValidDchar(uint c)
{
	return isValidDchar(c);
}

extern (C++) extern int HtmlNamedEntity(ubyte* p, int length);