public  function convert($str)
	{
		if ($this->from != $this->to)
		{
			$str = iconv($this->from, $this->to, $str);
		}

		if ($str === false)
		{
			// the convertion was a failure
			throw new Exception('The convertion from "'.$this->from.'" to "'.$this->to.'" was a failure.');
		}

		// deal with BOM issue for utf-8 text
		if ($this->to == 'UTF-8')
		{
			if (substr($str, 0, 3) == "\xef\xbb\xbf")
			{
				$str = substr($str, 3);
			}
			if (substr($str, -3, 3) == "\xef\xbb\xbf")
			{
				$str = substr($str, 0, -3);
			}
		}

		return $str;
	}