[TYPO3-dev] Currency display from static_info_tables

Georg Schönweger georg.schoenweger at gmail.com
Mon Aug 29 08:59:12 CEST 2011


Hi Richard,

some time ago i had a similar problem were special characters
occasionally didn't show up correctly after moving to a new server.
I could fix this by setting;
$TYPO3_CONF_VARS['SYS']['setDBinit'] = 'SET NAMES latin1'; // latin1 or
utf8, depends if your database is "real" utf8 or not.
in localconf.php.

Strange thing is that the default connection to the database on the
system was already latin1 .. Also Typo3 version affected were < 4.3 so
no utf8 by default.
Don't know why this fixed the issue, maybe Typo3 was somehow altering
the default connection mode.

- Georg


Am 28.08.2011 07:02, schrieb Richard Davies:
> Hi all,
>
> I'm been adding multi-currency support to a shopping system, but having an
> issue with the currency characters displaying correctly.
> The system fetches the currency character from cu_symbol_left from
> static_currencies in static_info_tables.
> The issue I am having is that a few symbols occasionally display
> incorrectly.
> The euro symbol (€) is occasionally, maybe one in every ten times, is
> displaying as (€).
> The pound is occasionally displaying as £ instead of £. I understand that
> the pound is actually stored as £, however if I remove the  it will
> display £ then occasionally wont display any symbol. I'm confused, as there
> should be nothing that influences the code: it always calls the same
> function for display. Is this a mysql bug? I know there may be a character
> encoding issue, but most of the time its displaying the correct symbol. Its
> just every one in 10 or so fetches from the database it will display the
> incorrect symbol.
>
> $customiso = $GLOBALS["TSFE"]->fe_user->getKey("ses","customiso");
>             if($customiso){
>                 $iso = $customiso;
>             }
>             $data=$GLOBALS['TYPO3_DB']->exec_SELECTquery('cu_symbol_left,
> cu_thousands_point, cu_decimal_point, conversion','
> static_currencies','cu_iso_nr=\''.$iso.'\'');
>             $row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($data);
>             $thousandsSeperator =  $row['cu_thousands_point'];
>             $decimalSeperator =  $row['cu_decimal_point'];
> //added column conversion to static_currencies, it was doing this before i
> added the row conversion though
>             $exchangeVersion = $row['conversion'];
>             //because UTF-8 doesnt play well with certain currencies e.g.
> pound
>             $convmap= array(0x0100, 0xFFFF, 0, 0xFFFF);
>             $encutf= mb_encode_numericentity($row['cu_symbol_left'],
> $convmap, 'UTF-8');
>             echo utf8_decode($encutf);
>
> Thanks
> Richard
> _______________________________________________
> TYPO3-dev mailing list
> TYPO3-dev at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-dev




More information about the TYPO3-dev mailing list