function utf8CharToUnumber($str, $hex = 0) {
		$ord = ord(substr($str, 0, 1)); // First char

		if (($ord & 192) == 192) { // This verifyes that it IS a multi byte string
			$binBuf = '';
			for ($b = 0; $b < 8; $b++) { // for each byte in multibyte string...
				$ord = $ord << 1; // Shift it left and ...
				if ($ord & 128) { // ... and with 8th bit - if that is set, then there are still bytes in sequence.
					$binBuf .= substr('00000000' . decbin(ord(substr($str, $b + 1, 1))), -6);
				} else {
					break;
				}
			}
			$binBuf = substr('00000000' . decbin(ord(substr($str, 0, 1))), -(6 - $b)) . $binBuf;

			$int = bindec($binBuf);
		} else {
			$int = $ord;
		}

		return $hex ? 'x' . dechex($int) : $int;
	}