0

我用

"name": "friendsofsymfony/rest-bundle",
"version": "1.7.7",

"name": "jms/serializer-bundle",
"version": "0.13.0"

当我的回复包含西里尔语单词时,我的回复如下:

return View::create()
->setStatusCode(200)
->setData($response)
->setSerializationContext(
    SerializationContext::create()
        ->setGroups(array('my_group'))
);

我收到一个错误:

{
    "message": "Your data could not be encoded because it contains invalid UTF8 characters.",
    "class": "RuntimeException",
    "trace": [
      {
        "namespace": "",
        "short_class": "",
        "class": "",
        "type": "",
        "function": "",
        "file": "/home/ivan/host/aog-code/vendor/jms/serializer/src/JMS/Serializer/JsonSerializationVisitor.php",
        "line": 36,
        "args": []
      },

$response是数组,但是我发现问题是,$rest = substr("abcdef", -1);当我使用$shortName = $entity->getFirstName() . ($last ? ' ' . ' ' . preg_replace("/^([a-zа-я]).*$/isu", "$1", trim($last)) . '.' : '');有规范 sumbhol 并且没有错误的响应后,我的符号不好,我不明白为什么会发生这种情况。

4

0 回答 0