[Typo3-dev] tslib_fe->csConv()
Martin T. Kutschker
Martin.T.Kutschker at blackbox.net
Tue Apr 20 22:57:20 CEST 2004
Hi!
Is it correct that this method should only be used to convert labels?
That is when used without the optional $from argument.
I was thinking about two other possible conversions: from DB charset and
from locale charset.
So instead of the mentioned method perhaps we could have these ones:
tslib_fe->labelConv()
tslib_fe->dbConv()
tslib_fe->localeConv()
labelConv() is just a new name for consitency.
dbConv would get it's "internal" conversoin arguments by
SYS[forced_charset] and config.metaCharset. Can be used on results of
SQL queries.
localeConv could make some eductated guess on the charset of the locale,
but should make use of an override via something like
config.localeCharset. Can be used on results of locale dependent system
libraries (like strftime()).
The initialization of the interbal charset vars could be moved into the
"constructor" (instead of initLLvars).
Does it make sense? Am I missing something?
Masi
PS:
Guessing of the locale charset could be done via a platform dependent
(Unix uses mostl iso, Windows MS uses specifc charsets, OS X uses ???)
mapping table.
Something like this:
Take the language part out of the locale (de_DE => de, pl-PL => pl,
italian => it).
Make a lookup in the table of the platform (de: Unix => iso-8859-1, MS
=> windows-1252)
More information about the TYPO3-dev
mailing list