From 7d3d1615d5e5aaaf5b9754eddd9db7d66b73a224 Mon Sep 17 00:00:00 2001 From: kj Date: Tue, 22 Nov 2022 00:59:20 -0400 Subject: [PATCH] Fix View:txt and add charset. --- src/Libs/View.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Libs/View.php b/src/Libs/View.php index a5a60e9..5e31f1d 100644 --- a/src/Libs/View.php +++ b/src/Libs/View.php @@ -54,7 +54,7 @@ class View extends Neuron { * @param object $data */ public function json(object $data) { - header('Content-Type: application/json'); + header('Content-Type: application/json; charset=utf-8'); print(json_encode($data)); } @@ -64,8 +64,8 @@ class View extends Neuron { * @param string $txt */ public function text(string $txt) { - header('Content-Type: text/plain'); - print(json_encode($txt)); + header('Content-Type: text/plain; charset=utf-8'); + print($txt); } } ?>