[TYPO3-core] RFC: Respect target if specified in file header

Michael Stucki michael at typo3.org
Thu Dec 1 21:34:01 CET 2005


Hi Martin,

>> - The five-line detection works but is ugly. If anybody has a better
>> way for this, please let me know.
> 
> UTF-8 can be auto-detected. If no charset is found with your detection you
> could try again with an UTF-8 detector. If there is interest I'll write a
> routine for t3lib_cs.

Just for me to know: How can it be detected?
If it's not too much work, such a feature would be nice.

>> - The character set lookup is based on a regular expression that can
>> be extended easily.
> 
> Could you move the charset detection in a separate function? The function
> should take a string as argument, so it can be used from other code.

Is there a need for that? Otherwise I would wait with that. t3lib_div grows
more and more...

>> - 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()).
> 
> I'm not quite happy with the current logic. IMHO auto-conversion should
> only be done when required. When turned on every single file request will
> be slowed down.

I don't think it is a big slow-down, do you think so?

> As I see it, this conversion comes in handy, but should not be needed in
> normal circumstances. It's a hack/workaround for an incomplete conversion.
> 
> I'm not sure if a GLOBAL setting is the correct answer. This code uses the
> global setting unless an explicitely enable/disable parameter is used.
> 
> function writeFile($file,$content,$autoConvCS=null) {
> if (is_null($autoConvCS)) {
> $autoConvCS = $GLOBALS['TYPO3_VAR']['SYS']['fileCharsetAutoConcv'];
> }
> ...
> }

Thanks.

> But honestly I think an admin should know what he does an convert all
> resources (db, files, etc).

It does not depend on the admin only. Trust me :-)

- 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