function utf8_byte2char_pos($str, $pos) {
		$n = 0; // number of characters
		for ($i = $pos; $i > 0; $i--) {
			$c = (int) ord($str{$i});
			if (!($c & 0x80)) // single-byte (0xxxxxx)
			{
				$n++;
			}
			elseif (($c & 0xC0) == 0xC0) // multi-byte starting byte (11xxxxxx)
			{
				$n++;
			}
		}
		if (!strlen($str{$i})) {
			return FALSE;
		} // offset beyond string length

		return $n;
	}