[TYPO3-v4] [TYPO3-core] FYI #15601: Change all core PHP files to UTF8 encoding

Stefano Kowalke blueduck at gmx.net
Tue Sep 7 16:23:57 CEST 2010


Hey,

> There are also still ISO-8859-1 files in trunk! (also outlined in
> thread/RFC) ;-)

Most of the files are still in Ascii. I took this code:

for i in `find /Path/to/trunk -type f -not -path "*/.svn/*" -not -path
"*/sysext/fluid/*" -not -path "*/sysext/extbase/*" -not -path
"*/sysext/adodb/adodb/*" -name *.php`; do file -i $i >>
fileencoding.txt; done;

and create the file "fileencoding.txt" which you can examine with grep:

# count all files
cat fileencoding.txt | wc -l
781

# count all ascii encoded files
cat fileencoding.txt | grep ascii | wc -l
507

# count all utf-8 encoded files
cat fileencoding.txt | grep utf-8 | wc -l
274

I don't know how the encoding detection works but I wrote a
PHP_CodeSniffer Sniff [1] for that and let it run by the hudson [2]. Its
quite the same, even the most of extbase and fluid files aren't in UTF-8.

Is there a reason for that?

[1]
http://forge.typo3.org/projects/team-php_codesniffer/repository/entry/CodeSniffer/Standards/TYPO3/Sniffs/Files/EncodingUtf8Sniff.php
[2] http://forge.typo3.org:8080/job/typo3v4-core/770/violations/?


More information about the TYPO3-project-v4 mailing list