NagVis / nagvis

Visualization addon for your open source monitoring core
http://nagvis.org/
GNU General Public License v2.0
113 stars 73 forks source link

Error (ValueError): mb_convert_encoding(): Argument #2 ($to_encoding) must be a valid encoding, "" #354

Closed schnudd31do3 closed 9 months ago

schnudd31do3 commented 9 months ago

The Error "(ValueError): mb_convert_encoding(): Argument #2 ($to_encoding) must be a valid encoding,... " is appearing at some people ( not each) with firefox browser after successfully logged-in. It is shown instead of the nagvis website. image

The error is coming from using debricated method "mbstring.internal_encoding" in nagvis/share/server/core/ext/php-gettext-1.0.12/gettext.inc at line 170 and it is depricated since PHP5.6.0.

To solve, change the line return (isset($text_domains[$domain]->codeset))? $text_domains[$domain]->codeset : ini_get('mbstring.internal_encoding'); to return (isset($text_domains[$domain]->codeset))? $text_domains[$domain]->codeset : mb_internal_encoding();

Edit: The used "php-php-gettext", included in nagvis/share/server/core/ext seems to be on 1.0.12-5.

I exported all the files from 1.0.12-6 (from debian sid) and replaced them with the former ones in nagvis/share/server/core/ext/php-gettext-1.0.12.

The corresponding line in gettext.inc this version is: return (isset($text_domains[$domain]->codeset))? $text_domains[$domain]->codeset : ini_get('default_charset');

The version 1.0.12-6 solved the issue, too.