ApMd |U8* |utf8_to_bytes |NN U8 *s|NN STRLEN *lenp
Apd |int |bytes_cmp_utf8 |NN const U8 *b|STRLEN blen|NN const U8 *u \
|STRLEN ulen
-ApMd |U8* |bytes_from_utf8|NN const U8 *s|NN STRLEN *lenp|NULLOK bool *is_utf8
+ApMd |U8* |bytes_from_utf8|NN const U8 *s|NN STRLEN *lenp|NN bool *is_utf8p
ApMd |U8* |bytes_to_utf8 |NN const U8 *s|NN STRLEN *lenp
ApdD |UV |utf8_to_uvchr |NN const U8 *s|NULLOK STRLEN *retlen
ApdD |UV |utf8_to_uvuni |NN const U8 *s|NULLOK STRLEN *retlen
PERL_CALLCONV int Perl_bytes_cmp_utf8(pTHX_ const U8 *b, STRLEN blen, const U8 *u, STRLEN ulen);
#define PERL_ARGS_ASSERT_BYTES_CMP_UTF8 \
assert(b); assert(u)
-PERL_CALLCONV U8* Perl_bytes_from_utf8(pTHX_ const U8 *s, STRLEN *lenp, bool *is_utf8);
+PERL_CALLCONV U8* Perl_bytes_from_utf8(pTHX_ const U8 *s, STRLEN *lenp, bool *is_utf8p);
#define PERL_ARGS_ASSERT_BYTES_FROM_UTF8 \
- assert(s); assert(lenp)
+ assert(s); assert(lenp); assert(is_utf8p)
PERL_CALLCONV U8* Perl_bytes_to_utf8(pTHX_ const U8 *s, STRLEN *lenp);
#define PERL_ARGS_ASSERT_BYTES_TO_UTF8 \
assert(s); assert(lenp)
=for apidoc bytes_from_utf8
Converts a potentially UTF-8 encoded string C<s> of length C<*lenp> into native
-byte encoding. On input, the boolean C<*is_utf8> gives whether or not C<s> is
+byte encoding. On input, the boolean C<*is_utf8p> gives whether or not C<s> is
actually encoded in UTF-8.
Unlike L</utf8_to_bytes> but like L</bytes_to_utf8>, this is non-destructive of
the input string.
-Do nothing if C<*is_utf8> is 0, or if there are code points in the string
-not expressible in native byte encoding. In these cases, C<*is_utf8> and
+Do nothing if C<*is_utf8p> is 0, or if there are code points in the string
+not expressible in native byte encoding. In these cases, C<*is_utf8p> and
C<*lenp> are unchanged, and the return value is the original C<s>.
-Otherwise, C<*is_utf8> is set to 0, and the return value is a pointer to a
+Otherwise, C<*is_utf8p> is set to 0, and the return value is a pointer to a
newly created string containing a downgraded copy of C<s>, and whose length is
returned in C<*lenp>, updated.
*/
U8 *
-Perl_bytes_from_utf8(pTHX_ const U8 *s, STRLEN *lenp, bool *is_utf8)
+Perl_bytes_from_utf8(pTHX_ const U8 *s, STRLEN *lenp, bool *is_utf8p)
{
U8 *d;
const U8 *start = s;
PERL_ARGS_ASSERT_BYTES_FROM_UTF8;
PERL_UNUSED_CONTEXT;
- if (!*is_utf8)
+ if (!*is_utf8p)
return (U8 *)start;
/* ensure valid UTF-8 and chars < 256 before converting string */
s++;
}
- *is_utf8 = FALSE;
+ *is_utf8p = FALSE;
Newx(d, (*lenp) - count + 1, U8);