Skip to content

Commit 80bfaa6

Browse files
authored
Merge pull request #3 from REZ1DENT3/master
add option in json_encode
2 parents a8d2ed0 + 991a476 commit 80bfaa6

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/PHPixie/HTTP/Responses.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function redirect($url, $statusCode = 302)
5959
*/
6060
public function json($data)
6161
{
62-
$string = json_encode($data);
62+
$string = json_encode($data, JSON_UNESCAPED_UNICODE);
6363

6464
return $this->stringResponse(
6565
$string,
@@ -165,4 +165,4 @@ protected function buildResponse($headers, $body, $statusCode = 200, $reasonPhra
165165
$messages = $this->builder->messages();
166166
return new Responses\Response($messages, $headers, $body, $statusCode, $reasonPhrase);
167167
}
168-
}
168+
}

tests/PHPixie/Tests/HTTP/ResponsesTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public function testRedirect()
6868
public function testJson()
6969
{
7070
$data = array('a' => 1);
71-
$string = json_encode($data);
71+
$string = json_encode($data, JSON_UNESCAPED_UNICODE);
7272

7373
$response = $this->prepareStringResponse(
7474
$string,
@@ -193,4 +193,4 @@ protected function getStream()
193193
{
194194
return $this->quickMock('\PHPixie\HTTP\Messages\Stream\Implementation');
195195
}
196-
}
196+
}

0 commit comments

Comments
 (0)