Hello all,
I would like to use
encrypter service however it causes "forInvalidJSON('MalformedUTF-8...')" error.
I have configured the encryption key and left provider as OpenSSL in config. Any help appriciated.
Code:
Code:
$arr=['encryptedKey'=>service('encrypter')->encrypt('Deneme123')];
Error:
Code:
<br/><b>Fatalerror</b>: UncaughtCodeIgniter\Format\Exceptions\FormatException: Failedtoparsejsonstring,
error: "MalformedUTF-8characters,
possiblyincorrectlyencoded".in/home/admin/web/api.sandbox.com/public_html/v1/vendor/codeigniter4/framework/system/Format/Exceptions/FormatException.php: 9Stacktrace: #0/home/admin/web/api.sandbox.com/public_html/v1/vendor/codeigniter4/framework/system/Format/JSONFormatter.php(67): CodeIgniter\Format\Exceptions\FormatException: : forInvalidJSON('MalformedUTF-8...')#1/home/admin/web/api.sandbox.com/public_html/v1/vendor/codeigniter4/framework/system/API/ResponseTrait.php(414): CodeIgniter\Format\JSONFormatter->format(Array)#2/home/admin/web/api.sandbox.com/public_html/v1/vendor/codeigniter4/framework/system/API/ResponseTrait.php(134): CodeIgniter\Debug\Exceptions->format(Array)#3/home/admin/web/api.sandbox.com/public_html/v1/vendor/codeigniter4/framework/system/Debug/Exceptions.php(166): CodeIgniter\Debug\Exceptions->respond(Array,
500)#4[
internalfunction
]: CodeIgniter\Debug\Exceptioin<b>/home/admin/web/api.sandbox.com/public_html/v1/vendor/codeigniter4/framework/system/Format/Exceptions/FormatException.php</b>online<b>9</b><br/>{
"title": "ErrorException",
"type": "ErrorException",
"code": 500,
"message": "Uncaught CodeIgniter\\Format\\Exceptions\\FormatException: Failed to parse json string, error: \"Malformed UTF-8 characters, possibly incorrectly encoded\". in /home/admin/web/api.sandbox.com/public_html/v1/vendor/codeigniter4/framework/system/Format/Exceptions/FormatException.php:9\nStack trace:\n#0 /home/admin/web/api.sandbox.com/public_html/v1/vendor/codeigniter4/framework/system/Format/JSONFormatter.php(67): CodeIgniter\\Format\\Exceptions\\FormatException::forInvalidJSON('Malformed UTF-8...')\n#1 /home/admin/web/api.sandbox.com/public_html/v1/vendor/codeigniter4/framework/system/API/ResponseTrait.php(414): CodeIgniter\\Format\\JSONFormatter->format(Array)\n#2 /home/admin/web/api.sandbox.com/public_html/v1/vendor/codeigniter4/framework/system/API/ResponseTrait.php(134): CodeIgniter\\Debug\\Exceptions->format(Array)\n#3 /home/admin/web/api.sandbox.com/public_html/v1/vendor/codeigniter4/framework/system/Debug/Exceptions.php(166): CodeIgniter\\Debug\\Exceptions->respond(Array, 500)\n#4 [internal function]: CodeIgniter\\Debug\\Exceptio",
"file": "/home/admin/web/api.sandbox.com/public_html/v1/vendor/codeigniter4/framework/system/Format/Exceptions/FormatException.php",
"line": 9,
"trace": [
{
"function": "shutdownHandler",
"class": "CodeIgniter\\Debug\\Exceptions",
"type": "->",
"args": []
}
]
}