> Given a Unicode UTF8 character, how would you get the character at the
> very next code point?

Check last byte. If it is between 0x80 and 0xBE, add one point to last
byte and return all bytes.

If last byte is 0xBF, set it to 0x80 and repeat 0x80-0xBE and 0xBF
checks on next byte.

If next byte is 0xDF, convert it it 0xE0 0x80 and return all bytes.

If next byte is 0xEF, convert it to 0xF0 0x80 and return all bytes.

If next byte is 0xF7, convert it to 0xF8 0x80 and return all bytes.

If next byte is 0xFB, convert it to 0xFC 0x80 and return all bytes.

If next byte is set to some other value between 0xC0 and 0xFA, add one
point to it and return all bytes.

If next byte is set to FD, next unicode codepoint is 0x00.

Or calculate codepoint of utf-8 character, add one point and convert it
back to utf-8.

-- 
Tomas

-- 
PHP Unicode & I18N Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to