
czw., 25 wrz 2025 o 10:59 Dominique Devienne via Boost < boost@lists.boost.org> napisał(a):
On Thu, Sep 25, 2025 at 10:34 AM Klemens Morgenstern via Boost <boost@lists.boost.org> wrote:
1. a type-safe alternative to const char * (no size_t)
What's not type-safe about `const char*`?
2. a std::string_view that guarantees a null at the end (with size_t)
That one is useful for a Boost.SQLite wrapper.
But not with a no-embedded-null requirement, as SQLite is just fine storing those.
Yes, it's string-based built-in SQL functions would stop of the first NULL (embedded or "final"), but that's a different issue.
So, if table data can contain null characters in the middle, how can I retrieve full strings in Boost.SQLite? Do I need to use a blob? Regards, &rzej;
And stored text values in SQLite are supposed to be in UTF-8 (or UTF-16), but that's not enforced!
The different between blob and text is several small, both can store arbitrary content, it's just that text can have custom collations, and might be displayed differently by programs, including the sqlite3 CLI, but fundamentally, both know their size, always, and can store arbitrary content.
Some places in the SQLite API do require a null-terminated string, with no option to explicit give a size, but in most places it matters, the size is explicit. --DD _______________________________________________ Boost mailing list -- boost@lists.boost.org To unsubscribe send an email to boost-leave@lists.boost.org https://lists.boost.org/mailman3/lists/boost.lists.boost.org/ Archived at: https://lists.boost.org/archives/list/boost@lists.boost.org/message/FIRTD3MX...