Commit 3beb1994 authored by 吕海涛's avatar 吕海涛 Committed by Paul Yang

add JSON_UNESCAPED_UNICODE option (#4191)

parent 26eeec93
...@@ -226,7 +226,7 @@ class GPBJsonWire ...@@ -226,7 +226,7 @@ class GPBJsonWire
$output->writeRaw("\"", 1); $output->writeRaw("\"", 1);
break; break;
case GPBType::STRING: case GPBType::STRING:
$value = json_encode($value); $value = json_encode($value, JSON_UNESCAPED_UNICODE);
$output->writeRaw($value, strlen($value)); $output->writeRaw($value, strlen($value));
break; break;
// case GPBType::GROUP: // case GPBType::GROUP:
......
...@@ -1563,7 +1563,7 @@ class Message ...@@ -1563,7 +1563,7 @@ class Message
} }
break; break;
case GPBType::STRING: case GPBType::STRING:
$value = json_encode($value); $value = json_encode($value, JSON_UNESCAPED_UNICODE);
$size += strlen($value); $size += strlen($value);
break; break;
case GPBType::BYTES: case GPBType::BYTES:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment