From 4dddfd622977f84f0cf41847aec9e728d02bec65 Mon Sep 17 00:00:00 2001 From: Joel Klinghed Date: Mon, 20 Oct 2025 22:01:05 +0200 Subject: uri: New module Decode URI encoded string, validating both hex and that encoded data is valid UTF-8. --- src/u.hh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 src/u.hh (limited to 'src/u.hh') diff --git a/src/u.hh b/src/u.hh new file mode 100644 index 0000000..439d6dc --- /dev/null +++ b/src/u.hh @@ -0,0 +1,21 @@ +#ifndef U_HH +#define U_HH + +#include + +namespace u { + +enum class ReadError : uint8_t { + Invalid, // Invalid sequence + End, // At end (it == end) + Incomplete, // Too few bytes +}; + +enum class ReadErrorReplace : uint8_t { + End, // At end (it == end) + Incomplete, // Too few bytes +}; + +} // namespace u + +#endif // U_HH -- cgit v1.2.3-70-g09d2