in reply to Re: Re^7: Warning: Unicode bytes!
in thread Warning: Unicode bytes!

I don't find it that hard to come up with cases where I'd want to look at the bytes used to represent some UTF-8 string. Probably these could be done by unsetting the UTF-8 bit on the string (or on a copy of it), but there being more than one way is Perlish.

For example, I might just want to know the storage size of a UTF-8 string. Perhaps I have an algorithm that compresses using the concepts of bytes but I want it to "just work" when given a string, whether it is UTF-8 or not. Perhaps I want to transmit a UTF-8 string over a system that has problems with some specific bytes and I want to check for those bytes. Perhaps I want to uuencode a UTF-8 string. Perhaps I need to compute a byte-based checksum of a UTF-8 string.

- tye