[Phpmyadmin-devel] Code cleanup - $charset global variable

Piotr Przybylski piotr.prz at gmail.com
Thu Mar 10 18:45:16 CET 2011

2011/3/10 Marc Delisle <marc at infomarc.info>:
> Piotr Przybylski a écrit :
>> In many files there are about 80-100 references to $GLOBALS['charset']
>> (or just $charset) variable, which is always set to 'utf-8'. It is not
>> a change that should go now, but after 3.4 is released I propose to:
>> - remove all references where it is used to generate HTTP headers and
>> HTML (we already have it hardcoded in many places)
>> - remove this variable and introduce it as a constant or, if only a
>> few references remain, just use string literals
> Looks like a good cleanup for 3.5.

Yes - too risky for 3.4, unless somebody finds enough time to test all
cases in which it is used.

>> A quick glance at code also revealed some a possible bug in comparison
>> with $charset_of_file - this var stores one of MySQL compatible
>> charset names, while our variable stores "utf-8", not "utf8".
> Better fix this one for 3.4, can you work on this?

Not during this week, but I will be able to look into this on Monday.

Piotr Przybylski

More information about the Developers mailing list