mirror of
https://github.com/neovim/neovim.git
synced 2025-09-12 06:18:16 +00:00
shada: Add support for converting strings that are read or written
This commit is contained in:
@@ -483,6 +483,21 @@ bool has_non_ascii(const char_u *s)
|
||||
return false;
|
||||
}
|
||||
|
||||
/// Return true if string "s" contains a non-ASCII character (128 or higher).
|
||||
/// When "s" is NULL false is returned.
|
||||
bool has_non_ascii_len(const char *const s, const size_t len)
|
||||
FUNC_ATTR_PURE
|
||||
{
|
||||
if (s != NULL) {
|
||||
for (size_t i = 0; i < len; i++) {
|
||||
if ((uint8_t) s[i] >= 128) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
* Concatenate two strings and return the result in allocated memory.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user