<?php
$original = "ÄäÖö";
$shortened = mb_substr( $original, 0, 1 );
echo json_encode( $original );// OK
echo json_encode( $shortened );// PHP Warning: json_encode(): Invalid UTF-8 sequence in argument...
?>
似乎 mb_substr 格式错误的多字节字符串!我在这里遗漏了什么或以某种方式滥用 mb_substr 吗?