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

Popular posts from this blog

C# random value from dictionary and tuple -

.htaccess - htaccess convert request to clean url and add slash at the end of the url -

cgi - How do I interpret URLs without extension as files rather than missing directories in nginx? -