From 7ff1adf809c047a349243e6e142a08d52dd69716 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jaakko=20Kera=CC=88nen?= jaakko.keranen@iki.fi
Date: Wed, 18 Aug 2021 06:51:48 +0300
Subject: [PATCH 1/1] String: Added a method to check UTF-8 validity
include/the_Foundation/string.h | 1 +
src/string.c | 4 ++++
2 files changed, 5 insertions(+)
diff --git a/include/the_Foundation/string.h b/include/the_Foundation/string.h
index 742d82d..6d16dd4 100644
--- a/include/the_Foundation/string.h
+++ b/include/the_Foundation/string.h
@@ -280,6 +280,7 @@ iLocalDef iRangecc range_CStr(const char *cstr) {
const char * cstr_Rangecc (iRangecc); /* returns NULL-terminated collected copy */
const iString * string_Rangecc (iRangecc); /* returns a collected String */
+iBool isUtf8_Rangecc (iRangecc); /* checks if the range is well-formed UTF-8 */
size_t length_Rangecc (iRangecc); /* returns number of characters in the range */
#define cmp_Rangecc(d, cstr) cmpCStrSc_Rangecc((d), (cstr), &iCaseSensitive)
diff --git a/src/string.c b/src/string.c
index 3f786bc..33e9ee9 100644
--- a/src/string.c
+++ b/src/string.c
@@ -390,6 +390,10 @@ size_t length_String(const iString *d) {
return u8_mbsnlen((const uint8_t *) cstr_String(d), size_String(d));
}
+iBool isUtf8_Rangecc(iRangecc d) {
+}
size_t length_Rangecc(const iRangecc d) {
/*
size_t n = 0;
--
2.25.1
text/plain
This content has been proxied by September (ba2dc).