summaryrefslogtreecommitdiff
path: root/utf8.h
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2017-06-13 21:37:22 -0600
committerKarl Williamson <khw@cpan.org>2017-06-14 11:08:24 -0600
commit976c1b0821cf2c6b33779dfb8e251deaee29f7bd (patch)
tree9acf9412ad51295251008ef9c2cd89b055453ab1 /utf8.h
parent23b37b1241a38c682dd4cd59cd6355024048868d (diff)
downloadperl-976c1b0821cf2c6b33779dfb8e251deaee29f7bd.tar.gz
Add new function utf8_from_bytes_loc()
This is currently undocumented externally, so we can change the API if needed. This is like utf8_from_bytes(), but in the case of not being able to convert the whole string, it converts the initial substring that is convertible, and tells you where it had to stop.
Diffstat (limited to 'utf8.h')
-rw-r--r--utf8.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/utf8.h b/utf8.h
index 41db2f4b93..276fa2953f 100644
--- a/utf8.h
+++ b/utf8.h
@@ -1049,6 +1049,8 @@ is a valid UTF-8 character.
: _is_utf8_char_helper(s, e, 0))
#define is_utf8_char_buf(buf, buf_end) isUTF8_CHAR(buf, buf_end)
+#define bytes_from_utf8(s, lenp, is_utf8p) \
+ bytes_from_utf8_loc(s, lenp, is_utf8p, 0)
/*