Zefram wrote: > Dr.Ruud wrote: > >> A byte count can be very useful, >> for example if you need to stay >> within MySQL's max_allowed_packet >> when creating big SQL statements. >> > > For that purpose, what you need to know is the number of bytes that > you'll be sending to MySQL. This depends on the characters and how > you're encoding them for communication with MySQL, *not* on how Perl > is representing them internally. See previous messages about writing > UTF-8-encoded text to a file. > > -zefram > > I think the problem here is that we think of characters in Perl being in UTF-8. We need to get away from this idea and think of characters as *CHARACTERS* they only become bytes when encoded into some other format for transport out of the program. So if you want to send UTF-8 to MySQL you need to take you string and encode it to UTF-8 only then can you get a length of bytes from it. John PS This means we need to remove any talk of UTF-8 encoding for Perl characters from all documentation except the Perl Guts docs. ______________________________________________ This email has been scanned by Netintelligence http://www.netintelligence.com/emailThread Previous | Thread Next