MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / Utf8StringLength

Function Utf8StringLength

src/string.cpp:349–353  ·  view source on GitHub ↗

* Get the length of an UTF-8 encoded string in number of characters * and thus not the number of bytes that the encoded string contains. * @param s The string to get the length for. * @return The length of the string in characters. */

Source from the content-addressed store, hash-verified

347 * @return The length of the string in characters.
348 */
349size_t Utf8StringLength(std::string_view str)
350{
351 Utf8View view(str);
352 return std::distance(view.begin(), view.end());
353}
354
355bool strtolower(std::string &str, std::string::size_type offs)
356{

Callers 15

VerifyTownNameFunction · 0.85
CmdRenameWaypointFunction · 0.85
CmdPlaceSignFunction · 0.85
CmdRenameSignFunction · 0.85
CmdRenameDepotFunction · 0.85
CmdAlterGroupFunction · 0.85
CmdRenameStationFunction · 0.85
CmdRenameVehicleFunction · 0.85
GenerateCompanyNameFunction · 0.85
GeneratePresidentNameFunction · 0.85
CmdRenameCompanyFunction · 0.85
CmdRenamePresidentFunction · 0.85

Calls 2

beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected