U8 *
Perl_uv_to_utf8(pTHX_ U8 *d, UV uv)
{
+ if (uv < 0x100)
+ uv = NATIVE_TO_ASCII(uv);
if (uv < 0x80) {
*d++ = uv;
return d;
}
/*
-=for apidoc A|U8* s|utf8_to_uv|STRLEN curlen|STRLEN *retlen|U32 flags
+=for apidoc A|UV|utf8_to_uv|U8 *s|STRLEN curlen|STRLEN *retlen|U32 flags
Returns the character value of the first character in the string C<s>
which is assumed to be in UTF8 encoding and no longer than C<curlen>;
if (UTF8_IS_ASCII(uv)) {
if (retlen)
*retlen = 1;
- return *s;
+ return ASCII_TO_NATIVE(*s);
}
if (UTF8_IS_CONTINUATION(uv) &&