API response breaking special characters in French |
08-15-2021, 05:31 AM
(This post was last modified: 08-16-2021, 01:02 AM by gosocial2. Edit Reason: emphasize the $message )
Hi all,
I've encountered a very odd issue after translating a CI 4.1.3 app to French in which XHR response is received with messed up characters by the browser. <?php $id = 'doesntMatter'; $message = 'L\'enregistrement de Ville a été supprimé avec succès.'; $locale = $this->request->getLocale(); log_message('debug', 'locale: ', $locale); // it is 'fr' alright ?> When using: <?php return redirect()->to(route_to('cities'))->with('success', $message); ?> Browser outputs: L'enregistrement de Ville a été supprimé avec succès. But when using it in a RESTful controller as an API reponse: <?php $reponse = $this->respondDeleted(['id' => $id], $message); log_message('debug', var_export($response, true)); return $response; ?> In the log, $message is dumped correctly, but the browser outputs: L'enregistrement de Ville a été supprimé avec succès. I'm 100% positive that all PHP files and request headers are UTF-8. (Occurred with both Chrome and Safari) This looks like a framework bug, but I will appreciate any workaround suggestions to fix it before a possible bugfix. CodeIgniter Wizard (CRUD code generator for Mac) instantly scaffolds Bootstrap-based web applications with an administrative interface (admin templates include Bootstrap5) |
Messages In This Thread |
API response breaking special characters in French - by gosocial2 - 08-15-2021, 05:31 AM
RE: API response breaking special characters in French - by InsiteFX - 08-16-2021, 02:35 AM
RE: API response breaking special characters in French - by gosocial2 - 08-17-2021, 05:46 AM
|