Browse Source

Fix View:txt and add charset.

master
kj 1 year ago
parent
commit
7d3d1615d5
  1. 6
      src/Libs/View.php

6
src/Libs/View.php

@ -54,7 +54,7 @@ class View extends Neuron { @@ -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 { @@ -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);
}
}
?>

Loading…
Cancel
Save