WordPress.org

Make WordPress Core

Changes between Version 1 and Version 2 of Ticket #10377, comment 26


Ignore:
Timestamp:
01/02/2016 08:59:26 PM (6 years ago)
Author:
azaozz
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #10377, comment 26

    v1 v2  
    99> 2. Is there a good way to convert characters to bytes?   
    1010
    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 )`.
     11If 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 )`.
    1212
    1313Also this looks like a typo: