18 lines
278 B
PHP
18 lines
278 B
PHP
|
<?php
|
||
|
|
||
|
namespace Xpyun\util;
|
||
|
|
||
|
class Encoding
|
||
|
{
|
||
|
public static function CalcGbkLenForPrint($data)
|
||
|
{
|
||
|
return (strlen($data) + mb_strlen($data, "UTF8")) / 2;
|
||
|
}
|
||
|
|
||
|
public static function CalcAsciiLenForPrint($data)
|
||
|
{
|
||
|
return strlen($data);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
?>
|