mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-11-11 22:01:50 +08:00
fix: harden native analyzer conversions and JSON output (#22070)
This commit is contained in:
1 parent
c5814e36ff
commit
58c78b9aa4
13 files changed
+207
-78
No files matched your search
@@ -5,6 +5,12 @@
|
||||
#include "string_utils.h"
|
||||
|
||||
int main() {
|
||||
const std::string truncated_utf8 = "\xE3";
|
||||
assert(FullWidthToHalfWidth(truncated_utf8) == truncated_utf8);
|
||||
const std::string invalid_continuation = "\xE3\x80";
|
||||
assert(FullWidthToHalfWidth(invalid_continuation) == invalid_continuation);
|
||||
assert(FullWidthToHalfWidth("\xEF\xBC\xA1\xE3\x80\x80") == "A ");
|
||||
|
||||
constexpr size_t output_limit = 4096 * 3;
|
||||
std::string input(output_limit * 2, 'A');
|
||||
std::vector<char> guarded_output(output_limit + 2, 'x');
|
||||
|
||||
Reference in new issue
Block a user