Forums / Setup & design / Transf. string or complete file to UTF-8 in XML tpl
H-Works Agency
Wednesday 21 September 2005 10:23:11 am
My ezp 3.6.0 charset setting is on iso-8859-1 in .ini files.
My problem is that i need to return some content in xml files (for swf movie). The charset in this file needs to be UTF-8.
How can i encode the strings in utf-8 (something like the UTF8_encode() function in php) ? Would be some tpl function like {"string"|utf-8_encode}.
Or can i force the whole xml ".tpl" file to use the UTF-8 charset (i tried to add "<xml (...) encoding="UTF-8"> but doesn't change anything ) ?
The problem for all this is that accent are not interpreted with my default charset in flash.
Thanx for all.
Martin
EZP is Great
Björn [email protected]
Wednesday 21 September 2005 2:03:43 pm
turn your internal and template charset to utf8 this should help
watch your db charset though if your db does no support utf8 set it to latin1
Looking for a new job? http://www.xrow.com/xrow-GmbH/Jobs Looking for hosting? http://hostingezpublish.com ----------------------------------------------------------------------------- GMT +01:00 Hannover, Germany Web: http://www.xrow.com/
Wednesday 21 September 2005 6:16:56 pm
Thanx a lot but isn't it possible to encode in UTF-8 only for a string or a file ?
Why does the {*template charset=UTF-8*} at the start of the tpl doesn't do anything ?
Thanx again. Martin
Nathan Kelly
Wednesday 21 September 2005 11:54:25 pm
Hi, basically {*template charset=UTF-8*} in the template has no effect on the output, as far as I know this is only for EzP to pass the template code, Latin1 is the default template code and I'd suggest you don't change this unless its imperative, though I'm not sure what effect it actually has.
If you only need to encode a string I'd say you will have to write a PHP function for that particular string and maybe add some info to settings/template.ini to initialise the string conversion (don't ask me how), otherwise I'd go with Björn's suggestion, but thats as much as I know!
Hope that helps?
Cheers!
Pardon me while I burst into flames...
Thursday 22 September 2005 1:30:26 pm
Ok i found the answer for other users.
I found it because EZP handle this case !!! What a great software...
If you want to translate a string to UTF-8 go to :
template.ini => [PHP] PHPOperatorList[to_utf8]=utf8_encode Then in you template make a {$string|to_utf8}
It works for me and accent are displayed in my flash movie