EBCDIC control characters
Markus Scherer
markus.icu at gmail.com
Sat Jun 20 15:47:59 CDT 2020
On Sat, Jun 20, 2020 at 10:40 AM Richard Wordingham via Unicode <
unicode at unicode.org> wrote:
> I think almost all the functions in string.h go wrong if you want to
> treat NUL as an ordinary character. strncpy(), strncmp() and strncat()
> certainly do. Inserting NUL into a C string chops it up into multiple
> C strings.
>
Right, you need to carry ptr+length and use memcpy() etc. Or use
std::string in C++.
Since C++17 we can use std::string_view as *the* type for input strings
that are not to be modified. Inspired by the email from Hans, I looked, and
there is "syntax"sv for string_view literals.
https://en.cppreference.com/w/cpp/string/basic_string_view
https://en.cppreference.com/w/cpp/string/basic_string_view/operator%22%22sv
markus
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://corp.unicode.org/mailman/private/unicode/attachments/20200620/dac8c9c4/attachment.htm>
More information about the Unicode
mailing list