src/ccutil/unicharset.cpp
int UNICHARSET::step(const char *str) const {
  std::vector<UNICHAR_ID> encoding;
  std::vector<char> lengths;
  encode_string(str, true, &encoding, &lengths, nullptr);
  if (encoding.empty() || encoding[0] == INVALID_UNICHAR_ID) {
    return 0;
  }
  return lengths[0];
}
// Return the minimum number of bytes that matches a legal UNICHAR_ID,
// while leaving the rest of the string encodable. Returns 0 if the
// beginning of the string is not encodable.
// WARNING: this function now encodes the whole string for precision.
// Use encode_string in preference to repeatedly calling step.
Return the minimum number of bytes that matches a legal UNICHAR_ID,
while leaving the rest of the string encodable. Returns 0 if the
beginning of the string is not encodable.
WARNING: this function now encodes the whole string for precision.
Use encode_string in preference to repeatedly calling step.
Return the minimum number of bytes that matches a legal UNICHAR_ID while leaving the rest of the string encodable . Returns 0 if the beginning of the string is not encodable . WARNING : this function now encodes the whole string for precision . Use encode_string in preference to repeatedly calling step .
int UNICHARSET::step(const char *str) const {
  std::vector<UNICHAR_ID> encoding;
  std::vector<char> lengths;
  encode_string(str, true, &encoding, &lengths, nullptr);
  if (encoding.empty() || encoding[0] == INVALID_UNICHAR_ID) {
    return 0;
  }
  return lengths[0];
}
int UNICHARSET :: step ( const char * str ) const { std :: vector < UNICHAR_ID > encoding ; std :: vector < char > lengths ; encode_string ( str , true , & encoding , & lengths , nullptr ) ; if ( encoding . empty ( ) || encoding [ 0 ] == INVALID_UNICHAR_ID ) { return 0 ; } return lengths [ 0 ] ; }
Return the minimum number of bytes that matches a legal UNICHAR_ID,
while leaving the rest of the string encodable.
Return the minimum number of bytes that matches a legal UNICHAR_ID while leaving the rest of the string encodable .