[Typo3-UG Italy] charset utf-8 nel frontend

Marco Bascietto m.bascietto at datakey.it
Tue Jun 14 13:19:06 CEST 2005


Ciao a tutti,

sono nel mezzo dell'eterno problema del charset! 
Vorrei sia il BE sia il FE in utf-8. Quindi ho impostato 

$TYPO3_CONF_VARS['BE']['forceCharset'] = 'utf-8'
$TYPO3_CONF_VARS["SYS"]["multiplyDBfieldSize"] = '2';	

ed ho convertito il DB in utf-8.
Fin qui tutto bene.

Il setup del template prevede il charset utf-8 nella dichiarazione xml,
nei meta e nell'header HTTP:
config{
    # -------------------------------------------------------------
    #   DocType e Charset
    doctype            = xhtml_strict
    doctypeSwitch      = 1
    htmlTag_setParams  = xmlns="http://www.w3.org/1999/xhtml"
xml:lang="it"
    lang               ="it"
    xhtml_cleaning     = all
    htmlSpecialChars   = 1
    htmlTag_langKey    = it_IT

    renderCharset      = utf-8
    metaCharset        = utf-8
    additionalHeaders  = Content-Type:text/html;charset=utf-8
    # -------------------------------------------------------------
}

il quale genera correttamente il seguente HTML:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html
     PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xml:lang="it" xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />


che il browser interpreta effettivamente come utf-8.

Il problema nasce nel FE, i caratteri accentati non vengono interpretati correttamente e sono tutti convertiti nell'entita' &Atilde; seguito da un altra entita' variabile a seconda del caso.


Dove e' l'inghippo secondo voi?

Grazie,
Marco




More information about the TYPO3-UG-italy mailing list