[TYPO3-core] RFC: Respect target if specified in file header
Michael Stucki
michael at typo3.org
Thu Dec 1 21:20:48 CET 2005
Hello Franz,
> I think this is a useful feature. Of course it would be better if all
> files were converted automatically, however on big sites this is not
> easily managable.
Correct. One of the reasons why I wrote this function was that some of our
users work with editors that use ISO-8859-1 by default or even cannot deal
with UTF-8. So as long as the character set is specified in the file
header, this should become a clean solution.
>>boolean If true, the charset auto-conversion will be skipped
>>
> Reverse this into positive logic which is more understandable. ==>
> conversion will be done
Changed that.
>>preg_match('/^.*[\n\r].*[\n\r].*[\n\r].*[\n\r].*[\n\r][^\n\r]*/',$content,
>>$match);
>>
>
> These are more than two lines.
Corrected.
>>$internalCharset='iso-8859-1'; // Default charset of BE and FE
>>
> This should not be hardcoded here. Use a global variable.
This value is also the default for BE and FE (see class.tslib_fe.php and
lang.php). Usually it should not be needed, it's just a fallback for a case
that should never happen. So no change here.
>>- I am undecided whether PHP files should be converted, too (e.g. when
>>editing them in the Extension Manager). Any suggestions?
>>
> Yes, otherwise it would not be usable. But before writing them down they
> need to be converted back again.
Of course, this is how the function works.
Theoretically it already works if a PHP file would have
@charset "UTF-8"
in its header. Any comments on this?
>>- I did not find any examples but fear that there are calls of these
>>functions where the CS conversion should be skipped. In this case, please
>>change these functions and submit the $noCSconv parameter (see
>>t3lib_div::getUrl() and t3lib_div::writeFile()).
>
> This conversion should be skipped by default because in most cases this
> is not needed at all.
>
> $GLOBALS['TYPO3_VAR']['SYS']['fileCharsetAutoConcv'];
I'll wait for more comments but I'm open for that.
- michael
--
Use a newsreader! Check out
http://typo3.org/community/mailing-lists/use-a-news-reader/
More information about the TYPO3-team-core
mailing list