News for hackers. Stuff that matters.
Re:Validating UTF-8 strings using as little as 0.7 cycles pe... by vardump on Wednesday May 16, 2018 @12:35PM (#17083789)
> I think it would be faster to OR the entire string with itself, then finally check the 8th bit though.

The string could have NUL (zero) bytes in between.

Re:Validating UTF-8 strings using as little as 0.7 cycles pe... by zbjornson on Wednesday May 16, 2018 @12:40PM (#17083844)
You're right that it changes the behavior vs. what the current implementation is, but 0x0 is a valid ASCII character.
Re:Validating UTF-8 strings using as little as 0.7 cycles pe... by vardump on Wednesday May 16, 2018 @01:49PM (#17084637)
While you're technically right NUL is a part of ASCII set in practise it's rarely wanted in the data.