示例#1
0
		static inline ucs4::char_t read(iitor_t& input, const iitor_t& end)
		{
			assert(input != end);
			size_t size = byte_size_from_utf8_first(*input);

			ucs4::char_t current_char = static_cast<unsigned char>(*input);

			// Convert the first character
			if(size != 1) {
				current_char &= 0xFF >> (size + 1);
			}
示例#2
0
void utf8_iterator::update()
{
	// Do not try to update the current unicode char at end-of-string.
	if(current_substr.first == string_end)
		return;

	size_t size = byte_size_from_utf8_first(*current_substr.first);
	current_substr.second = current_substr.first + size;

	current_char = static_cast<unsigned char>(*current_substr.first);
	// Convert the first character
	if(size != 1) {
		current_char &= 0xFF >> (size + 1);
	}