summaryrefslogtreecommitdiffstats
path: root/lib.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib.c')
-rw-r--r--lib.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib.c b/lib.c
index 5916e1c6..b23a883a 100644
--- a/lib.c
+++ b/lib.c
@@ -5381,6 +5381,16 @@ val string_utf8(const char *str)
return obj;
}
+val string_utf8_from_buf(const char *str, size_t len)
+{
+ val obj = make_obj();
+ obj->st.type = STR;
+ obj->st.str = utf8_dup_from_buf(str, len);
+ obj->st.len = nil;
+ obj->st.alloc = 0;
+ return obj;
+}
+
val string_8bit(const unsigned char *str)
{
size_t l = strlen(coerce(const char *, str)), i;