diff --git a/core/lib/Drupal/Component/Utility/Unicode.php b/core/lib/Drupal/Component/Utility/Unicode.php
index e136a8971b..b10dd506aa 100644
--- a/core/lib/Drupal/Component/Utility/Unicode.php
+++ b/core/lib/Drupal/Component/Utility/Unicode.php
@@ -264,9 +264,10 @@ public static function truncateBytes($string, $len) {
       return substr($string, 0, $len);
     }
     // Scan backwards to beginning of the byte sequence.
-    // @todo Make the code more readable in https://www.drupal.org/node/2911497.
-    while (--$len >= 0 && ord($string[$len]) >= 0x80 && ord($string[$len]) < 0xC0) {
+    do {
+      $len--;
     }
+    while ($len >= 0 && ord($string[$len]) >= 0x80 && ord($string[$len]) < 0xC0);
 
     return substr($string, 0, $len);
   }
