Skip to content

Commit f7b44a3

Browse files
committed
Multibyte improvement
1 parent 8175733 commit f7b44a3

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Inp.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99

1010
namespace MaplePHP\Validate;
1111

12+
use ErrorException;
1213
use Exception;
14+
use MaplePHP\DTO\MB;
1315
use MaplePHP\Validate\Interfaces\InpInterface;
1416
use MaplePHP\DTO\Format\Str;
1517
use DateTime;
@@ -66,12 +68,14 @@ public static function value(mixed $value): self
6668

6769
/**
6870
* Get value string length
69-
* @param string $value
71+
* @param string $value
7072
* @return int
73+
* @throws ErrorException
7174
*/
7275
public function getLength(string $value): int
7376
{
74-
return strlen($value);
77+
$mb = new MB($value);
78+
return $mb->strlen();
7579
}
7680

7781
/**

0 commit comments

Comments
 (0)