[Typo3] Using special chars in the page title

Krystian Szymukowicz t33k.RE.MO.VE at RE.MO.VE.prolabium.com
Mon Oct 10 16:40:24 CEST 2005


Markus Friedrich wrote:
> Hi List!
> 
> I want to create a website in several languages, among them is polish and
> czech. Now I've a problem with the special chars used in these languages,
> the chars are typical converted to something like this "ůj". This works
> very well but in the page title "<title></title>" it doesn't. The page title
> is parsed through htmlspecialchars() - located in
> "tslib/class.tslib_pagegen.php". Htmlspecialchars converts the "&" in
> "&amp;" and the code will not be interpreted by the browser.
> 
> I can't see a possibility to use special chars in the title, perhaps anyone
> of you has a solution...

hi again Markus

I have created several multilanguage sites (polish, russian, german, 
english in one site) and I have never such problems.

You did not say anything about you TS config and charset coding. My 
basic assumption is that you do not use utf-8 in backend and frontend.

What I can advise you is to follow this steps as this is I think the 
best solution for multilanguage sites:

1. set utf-8 in your backend (go to "install" => "configure all" => find 
"[forceCharset]" and set it to 'utf-8"

OR you can add following line to your localconf.php
$TYPO3_CONF_VARS["BE"]["forceCharset"] = 'utf-8';

 From the documentation:
"
If you set TYPO3_CONF_VARS['BE']['forceCharset'] that value is used by 
default for "renderCharset". It is highly recommended to use 
TYPO3_CONF_VARS['BE']['forceCharset'] for multilingual websites in 
TYPO3. If you set that you don't have to worry about renderCharset and 
metaCharset - the same charset is used in the whole system.
"

So you do not need to set anything in template TS (no 
config.metaCharset, no config.renderCharset)



2. Add this TS to your root teamplate and modify it to your needs.

config.linkVars = L

    #this is your default language
config.sys_language_uid = 0
config.language = pl
config.locale_all = pl_PL

[globalVar = GP:L = 1]
config.sys_language_uid = 1
config.language = ru
config.locale_all = ru_RU
[end]

[globalVar = GP:L = 2]
config.sys_language_uid = 2
config.language = de
config.locale_all = de_DE
[end]

[globalVar = GP:L = 3]
config.sys_language_uid = 3
config.language = en
config.locale_all = en_EN
[end]

3. You can also think about changing database charset to uft. If you do 
not do it you can have problems while sorting text values. For example 
words beginning with language specific charser will go at the end of the 
list.
Frankly speaking I am not using database with charset set to utf-8 - no 
need for that as no sorting really used at my sites.

Anyway if you will stay with &#xxx; sorting will not work for you either.

4. The bad thing for you is that you need to change your current content 
  and remove every &#xxx; occurence and save it again.

(you can copy the whole content from textarea to windows NotePad and 
paste it from NotePad to textarea again - if you look then into html 
code the &#xxx should go away)


good luck


--
grtz
Krystian
Szymukowicz





More information about the TYPO3-english mailing list