add JSON_UNESCAPED_UNICODE option (#4191)

pull/4888/head
吕海涛 7 years ago committed by Paul Yang
parent 26eeec93e4
commit 3beb19945b
  1. 2
      php/src/Google/Protobuf/Internal/GPBJsonWire.php
  2. 2
      php/src/Google/Protobuf/Internal/Message.php

@ -226,7 +226,7 @@ class GPBJsonWire
$output->writeRaw("\"", 1);
break;
case GPBType::STRING:
$value = json_encode($value);
$value = json_encode($value, JSON_UNESCAPED_UNICODE);
$output->writeRaw($value, strlen($value));
break;
// case GPBType::GROUP:

@ -1563,7 +1563,7 @@ class Message
}
break;
case GPBType::STRING:
$value = json_encode($value);
$value = json_encode($value, JSON_UNESCAPED_UNICODE);
$size += strlen($value);
break;
case GPBType::BYTES:

Loading…
Cancel
Save