You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please stop modifying global settings such as default_charset and mb_internal_encoding(). This leads to data corruption and bug reports in other packages.
#207
Open
cmanley opened this issue
May 9, 2024
· 0 comments
I recently had an application that started having data corruption issues.
It all worked fine until another package installed this package as a dependency.
I traced it back to voku/helper/UTF8.php calling \mb_internal_encoding('UTF-8') while the application had set mb_internal_encoding to cp1252 during start up.
But that's not all, voku/helper/Bootup.php also calls ini_set('default_charset', 'UTF-8')
That is a very bad design practice imho. It's not right to just go around changing application settings and globals in a package meant for non-private use.
If one really has to modify a global (which I doubt), then it should be done temporarily and wrapped in a try...finally to reset it back.
The text was updated successfully, but these errors were encountered:
cmanley
changed the title
Please stop messing with global settings such as mb_internal_encoding(). This causes data corruption.
Please stop modifying global settings such as mb_internal_encoding(). This leads to data corruption and bug reports in other packages.
May 9, 2024
cmanley
changed the title
Please stop modifying global settings such as mb_internal_encoding(). This leads to data corruption and bug reports in other packages.
Please stop modifying global settings such as default_charset and mb_internal_encoding(). This leads to data corruption and bug reports in other packages.
May 9, 2024
I recently had an application that started having data corruption issues.
It all worked fine until another package installed this package as a dependency.
I traced it back to voku/helper/UTF8.php calling \mb_internal_encoding('UTF-8') while the application had set mb_internal_encoding to cp1252 during start up.
But that's not all, voku/helper/Bootup.php also calls ini_set('default_charset', 'UTF-8')
That is a very bad design practice imho. It's not right to just go around changing application settings and globals in a package meant for non-private use.
If one really has to modify a global (which I doubt), then it should be done temporarily and wrapped in a try...finally to reset it back.
The text was updated successfully, but these errors were encountered: