You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by je...@apache.org on 2014/12/13 23:49:08 UTC
thrift git commit: THRIFT-2884 Map does not serialize correctly for
JSON protocol in Go library Reverted commit
0a378709ab8b3b0de4bafde60a803da24096e8bd See JIRA for details
Repository: thrift
Updated Branches:
refs/heads/master 54d3969e4 -> 4991574b5
THRIFT-2884 Map does not serialize correctly for JSON protocol in Go library
Reverted commit 0a378709ab8b3b0de4bafde60a803da24096e8bd
See JIRA for details
Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/4991574b
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/4991574b
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/4991574b
Branch: refs/heads/master
Commit: 4991574b5e9696dd405afe80588cc2278149c80d
Parents: 54d3969
Author: Jens Geyer <je...@apache.org>
Authored: Sat Dec 13 23:48:33 2014 +0100
Committer: Jens Geyer <je...@apache.org>
Committed: Sat Dec 13 23:48:33 2014 +0100
----------------------------------------------------------------------
lib/php/lib/Thrift/Protocol/TJSONProtocol.php | 11 +----------
1 file changed, 1 insertion(+), 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/thrift/blob/4991574b/lib/php/lib/Thrift/Protocol/TJSONProtocol.php
----------------------------------------------------------------------
diff --git a/lib/php/lib/Thrift/Protocol/TJSONProtocol.php b/lib/php/lib/Thrift/Protocol/TJSONProtocol.php
index dfa07d8..6c93b09 100644
--- a/lib/php/lib/Thrift/Protocol/TJSONProtocol.php
+++ b/lib/php/lib/Thrift/Protocol/TJSONProtocol.php
@@ -215,15 +215,6 @@ class TJSONProtocol extends TProtocol
return dechex($val);
}
- private function json_encode_utf8($str) {
- $str = preg_replace_callback("/\\\\u([a-f0-9]{4})/",
- function ($matches) {
- return iconv('UCS-4LE','UTF-8', pack('V', hexdec('U' . $matches[1])));
- },
- json_encode($str));
- return preg_replace("|\\\\/|", "/", $str);
- }
-
private function writeJSONString($b)
{
$this->context_->write();
@@ -232,7 +223,7 @@ class TJSONProtocol extends TProtocol
$this->trans_->write(self::QUOTE);
}
- $this->trans_->write($this->json_encode_utf8($b));
+ $this->trans_->write(json_encode($b));
if (is_numeric($b) && $this->context_->escapeNum()) {
$this->trans_->write(self::QUOTE);