Changes between Version 1 and Version 2 of Ticket #10377, comment 26
- Timestamp:
- 01/02/2016 08:59:26 PM (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #10377, comment 26
v1 v2 9 9 > 2. Is there a good way to convert characters to bytes? 10 10 11 Nothing that is 100% compatible/reliable afaik.If you want to check the byte length of a string, `mb_strlen( $string, '8bit' )` should work well. That's the proper way to test it when the "real" mb_strlen() exists. If it doesn't exist, the [https://core.trac.wordpress.org/browser/tags/4.4/src/wp-includes/compat.php#L105 compat function] will return `strlen( $string )`.11 If you want to check the byte length of a string, `mb_strlen( $string, '8bit' )` should work well. That's the proper way to test it when the "real" mb_strlen() exists. If it doesn't exist, the [https://core.trac.wordpress.org/browser/tags/4.4/src/wp-includes/compat.php#L105 compat function] will return `strlen( $string )`. 12 12 13 13 Also this looks like a typo: