c++ - Does Re2 use string size or null termination? -
the title pretty it. if standard c++ string utf-8 characters has no 0 bytes scanning terminate @ end of string defined it's size? conversely, if string has 0 byte scanning stop @ byte, or continue full length of string? i've @ re2.h file , not seem address issue.
a std::string
containing utf-8 characters can´t have 0-bytes part of text
(only termination), because utf-8 doesn´t allow 0´s anywhere.
and given you´re using c++11-compliant, terminating 0 guaranteed
(doesn´t matter if use data()
or c_str()
. , data original data, so...).
see http://en.cppreference.com/w/cpp/string/basic_string/data
or standard (21.4.7.1/1 etc.).
=> processing of string stop @ 0
Comments
Post a Comment