21303 Posts in 5736 Topics by 2603 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 603 Views |
-
Unicode in templates

12 May 2011 at 9:16pm Last edited: 12 May 2011 9:17pm
I'm writing primarily a Norwegian site but writing the special Norwegian characters "ÆØÅ" inside templates doesn't work. Some question marks appears where the characters arrives. It works writing in the CMS editor to the database and then displaying, however in templates no. Is unicode in templates impossible?
My _config.php:
MySQLDatabase::set_connection_charset('utf8');
//test setting charset:
ContentNegotiator::set_encoding('utf8');// This line set's the current theme. More themes can be
// downloaded from http://www.silverstripe.org/themes/
SSViewer::set_theme('blackcandy');// Set the site locale
i18n::set_locale('nb_NO');//set default language
Translatable::set_default_locale('nb_NO');//Set languages to use
Translatable::set_allowed_locales(array(
'nb_NO', //Norwegian bokmal
'en_US', //US english
)
);Object::add_extension('SiteTree', 'Translatable');
Object::add_extension('SiteConfig', 'Translatable'); //2.4 or newer only// enable nested URLs for this site (e.g. page/sub-page/)
SiteTree::enable_nested_urls(); -
Re: Unicode in templates

14 May 2011 at 12:44am
Which editor do you use? Try to use Notepad++ and be sure that .ss files are having encoding 'UTF-8 without BOM'. Silverstripe has no problem with unicode characters.
| 603 Views | ||
|
Page:
1
|
Go to Top |


