// methods converting to user interface string ---------------------------
	
	/** Convert a string to HTML. 
	* @param string $string The string to convert
	* @param boolean $breaksForLineFeeds Wheather to convert line feeds to <BR>
	* $param boolean $preformatAndTab if set > 0 convert multiple spaces to non-breaking spaces
		and replace tabs by the specified number of non-breaking spaces
	* @return String with HTML */
	function toHtml($string, $breaksForLineFeeds=false, $preformatAndTab=0) {		
		if ($this->type=='html') return $string;
        if ($string===null) return '';
		$result = htmlspecialchars($string, ENT_QUOTES | $this->html_version_flag, $this->getLabelCharset());
		if ($breaksForLineFeeds) {
			$br = $this->html_version_ent=='ENT_XML1' || $this->html_version_ent=='ENT_XHTML'
				? "<br />\n" : "<br>\n";
			$result = preg_replace("/\r\n|\n\r|\n|\r/", $br, $result);
		}
		if ($preformatAndTab) {
			$result = str_replace("\t", str_pad(' ', $preformatAndTab), $result);
			$result = str_replace("  ", "&nbsp;&nbsp;", $result);
			$result = str_replace("&nbsp; ", "&nbsp;&nbsp;", $result);
		}
		return $result;
	}