[TYPO3-dev] how to set the charset correctly to UTF-8

Franz Holzinger franz at ttproducts.de
Mon Jan 9 11:37:34 CET 2012


Hello,

On 02/01/12 09:05, Franz Holzinger wrote:

> In tt_products I had to do a character conversion for the data entered
> into the fields: (tt_products/view/class.tx_ttproducts_info_view.php)
>
> foreach ($infoFields as $k => $fName) {
> if (!in_array($fName, $selectInfoFields)) {
> $fieldMarker = strtoupper($fName);
> $markerArray['###PERSON_' . $fieldMarker . '###'] =
> $TSFE->csConv($this->infoArray['billing'][$fName], $TSFE->metaCharset);
> $markerArray['###DELIVERY_' . $fieldMarker . '###'] =
> $TSFE->csConv($this->infoArray['delivery'][$fName], $TSFE->metaCharset);
> }
> }
>
> But why is this needed? On some sites the character conversion must be
> removed. The 'recs' is converted into another charset than UTF-8.
>
>
>
> <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
> ...
> <tr>
> <td><span
> class="tx-ttproducts-pi1-wrap1"><strong>Anrede:</strong></span></td>
> <td><span class="tx-ttproducts-pi1-wrap1"><select
> name="recs[personinfo][salutation]"
> id="field_personinfo_salutation"><option value="0">Herr</option><option
> value="1">Fr&auml;ulein</option><option value="2">Frau</option><option
> value="3">An</option></select></span></td>
>
> </tr>
> <tr>
> <td><span class="tx-ttproducts-pi1-wrap1"><strong>Name:
> </strong></span></td>
> <td><input type="text" name="recs[personinfo][name]" size="30"
> value=""></td>
> </tr>
> <tr>
> <td><span class="tx-ttproducts-pi1-wrap1"><strong>Firma:
> </strong></span></td>
> <td><input type="text" name="recs[personinfo][company]" size="30"
> value=""></td>
> </tr>
> <tr>
> <td><span class="tx-ttproducts-pi1-wrap1"><strong>Adresse:
> </strong></span></td>
> <td><textarea cols=30 rows=5 name="recs[personinfo][address]"
> wrap="off"></textarea></td>
> </tr>
>
> <tr>
> <td><span class="tx-ttproducts-pi1-wrap1"><strong>PLZ:
> </strong></span></td>
> <td><input type="text" name="recs[personinfo][zip]" size="5" value=""></td>
> </tr>
> <tr>
> <td><span class="tx-ttproducts-pi1-wrap1"><strong>Stadt:
> </strong></span></td>
> <td><input type="text" name="recs[personinfo][city]" size="50"
> value=""></td>
> </tr>
> <tr>
> <td><span class="tx-ttproducts-pi1-wrap1"><strong>Land:
> </strong></span></td>
> <td><select size="1" id="field_personinfo_country_code"
> name="recs[personinfo][country_code]" onchange="this.form.submit();">
>
> ...

is the character set inside of a FE extension really necessary or shall 
this be avoided somehow?

- Franz



More information about the TYPO3-dev mailing list