in reply to Re^5: A UTF8 round trip with MySQL
in thread A UTF8 round trip with MySQL
About the C code: you're talking about C code that tries to interpret the invalid utf-8, right?
Yes. I was specifically (but implicitly) referring to XS code, C code catered for Perl interaction. The UTF8 flag is interpreted as a promise that the buffer will be valid UTF8. Of course, it would be better to use Perl's macros for UTF8 handling, but that doesn't work if you're calling a library function that doesn't do SVs but does require valid UTF-8.
about the (removed) line: "Another possibility is careless use of utf8::upgrade()." That's removed because utf8::upgrade() is always safe (if you start out with valid utf-8 flags), right?
Exactly. The original author probably confused utf8::upgrade with Encode::_utf8_on.
|
|---|