Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: json_encode error: Malformed UTF-8 characters #17

Open
mxkyu opened this issue Oct 18, 2023 · 1 comment
Open

Error: json_encode error: Malformed UTF-8 characters #17

mxkyu opened this issue Oct 18, 2023 · 1 comment

Comments

@mxkyu
Copy link

mxkyu commented Oct 18, 2023

I have this error with lots of production data (it contains large json data):
GuzzleHttp\Exception\InvalidArgumentException: json_encode error: Malformed UTF-8 characters, possibly incorrectly encoded in /app/vendor/guzzlehttp/guzzle/src/Utils.php:299
In stack trace i found:
#4 /app/vendor/jkocik/laravel-profiler/src/Processors/BroadcastingProcessor.php(57): GuzzleHttp\Client->request('POST', 'http://localhos...', Array)
In file src/Processors/BroadcastingProcessor.php on line 57 i must do mb_convert_encoding():
mb_convert_encoding($dataTracker->data()->toArray(), 'UTF-8', 'UTF-8'),
and it works without any error.

Can you fix it feature versions?

@benascbr
Copy link

Same here.

GuzzleHttp\Exception\InvalidArgumentException: json_encode error: Malformed UTF-8 characters, possibly incorrectly encoded in /foobar/vendor/guzzlehttp/guzzle/src/Utils.php:298
Stack trace:
#0 /foobar/vendor/guzzlehttp/guzzle/src/Client.php(377): GuzzleHttp\Utils::jsonEncode()
#1 /foobar/vendor/guzzlehttp/guzzle/src/Client.php(328): GuzzleHttp\Client->applyOptions()
#2 /foobar/vendor/guzzlehttp/guzzle/src/Client.php(169): GuzzleHttp\Client->transfer()
#3 /foobar/vendor/guzzlehttp/guzzle/src/Client.php(189): GuzzleHttp\Client->requestAsync()
#4 /foobar/vendor/jkocik/laravel-profiler/src/Processors/BroadcastingProcessor.php(54): GuzzleHttp\Client->request()
#5 /foobar/vendor/jkocik/laravel-profiler/src/Processors/BroadcastingProcessor.php(40): JKocik\Laravel\Profiler\Processors\BroadcastingProcessor->broadcast()
#6 /foobar/vendor/jkocik/laravel-profiler/src/LaravelDataProcessor.php(58): JKocik\Laravel\Profiler\Processors\BroadcastingProcessor->process()
#7 /foobar/vendor/laravel/framework/src/Illuminate/Collections/Traits/EnumeratesValues.php(235): JKocik\Laravel\Profiler\LaravelDataProcessor->JKocik\Laravel\Profiler\{closure}()
#8 /foobar/vendor/jkocik/laravel-profiler/src/LaravelDataProcessor.php(56): Illuminate\Support\Collection->each()
#9 /foobar/vendor/jkocik/laravel-profiler/src/LaravelProfiler.php(96): JKocik\Laravel\Profiler\LaravelDataProcessor->process()
#10 /foobar/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): JKocik\Laravel\Profiler\LaravelProfiler->JKocik\Laravel\Profiler\{closure}()
#11 /foobar/vendor/laravel/framework/src/Illuminate/Container/Util.php(41): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()
#12 /foobar/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(81): Illuminate\Container\Util::unwrapIfClosure()
#13 /foobar/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(35): Illuminate\Container\BoundMethod::callBoundMethod()
#14 /foobar/vendor/laravel/framework/src/Illuminate/Container/Container.php(661): Illuminate\Container\BoundMethod::call()
#15 /foobar/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(1173): Illuminate\Container\Container->call()
#16 /foobar/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(205): Illuminate\Foundation\Application->terminate()
#17 /foobar/vendor/laravel/octane/src/ApplicationGateway.php(51): Illuminate\Foundation\Http\Kernel->terminate()
#18 /foobar/vendor/laravel/octane/src/Worker.php(110): Laravel\Octane\ApplicationGateway->terminate()
#19 /foobar/vendor/laravel/octane/bin/swoole-server(120): Laravel\Octane\Worker->handle()
#20 [internal function]: {closure}()
#21 /foobar/vendor/laravel/octane/bin/swoole-server(170): OpenSwoole\Server->start()
#22 {main}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants