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

Laravel FirePHPHandler encoding problem #875

Closed
Sogl opened this issue Oct 26, 2016 · 2 comments
Closed

Laravel FirePHPHandler encoding problem #875

Sogl opened this issue Oct 26, 2016 · 2 comments

Comments

@Sogl
Copy link

Sogl commented Oct 26, 2016

Hello!

Monolog library is used in Laravel framework by default. I did settings to integrate it with FirePHP console.
Docs:
https://laravel.com/docs/5.3/errors#custom-monolog-configuration

Lines from my bootstrap/app.php:

//my monolog configuration
$app->configureMonologUsing(function($monolog) {
    $monolog->setHandlers([new \Monolog\Handler\FirePHPHandler()]);

   //this line also works
   //$monolog->pushHandler(new \Monolog\Handler\FirePHPHandler());
});

My laravel.log becomes clear with this code.

OK. Let's send something:

Log::info("Something");

Output:
image

Works great.
But what happened if we put some Russian letters and other unicode symbols?

Log::info("Что-то");
Log::info("Odómetro");

Output:
image

Something wrong.

OK, disable our FirePHPHandler and refresh our page.
Output in laravel.log:

[2016-10-26 17:08:55] local.INFO: Что-то  
[2016-10-26 17:08:55] local.INFO: Odómetro  

Works as it should be.

What's wrong with FirePHPHandler?

Env:
Windows 7 x64
Firefox 49.0.2
Monolog 1.21.0

@Seldaek
Copy link
Owner

Seldaek commented Nov 13, 2016

I would guess:

  • either your page encoding is not set correctly (you should have a Content-Type: text/html; charset=utf8 header)
  • or you have the wrong encoding set in your php file calling Log::info
  • or it's a bug in firebug..

The Firebug handler doesn't do anything special with the input so I am not sure what to say.

@Sogl
Copy link
Author

Sogl commented Nov 15, 2016

either your page encoding is not set correctly (you should have a Content-Type: text/html; charset=utf8 header)

I have HTML5 <meta charset="UTF-8">, also tried with <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />.
AddDefaultCharset UTF-8 in .htacccess to be sure 😆

or you have the wrong encoding set in your php file calling Log::info

Set correctly. UTF8 without BOM.

or it's a bug in firebug..

Or in FirePHP. Issue created:
firephp/insight#16

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