Forums / Setup & design / Transf. string or complete file to UTF-8 in XML tpl

Transf. string or complete file to UTF-8 in XML tpl

Author Message

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 Dieding@xrow.de

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/

H-Works Agency

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

EZP is Great

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...

H-Works Agency

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

EZP is Great

eZ debug

Timing: Jan 31 2025 06:05:32
Script start
Timing: Jan 31 2025 06:05:32
Module start 'content'
Timing: Jan 31 2025 06:05:32
Module end 'content'
Timing: Jan 31 2025 06:05:33
Script end

Main resources:

Total runtime0.2317 sec
Peak memory usage2,048.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0045 588.1563180.8125
Module start 'content' 0.00450.0068 768.968897.9609
Module end 'content' 0.01130.2204 866.9297526.6250
Script end 0.2316  1,393.5547 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00311.3221200.0002
Check MTime0.00120.5362200.0001
Mysql Total
Database connection0.00050.211610.0005
Mysqli_queries0.188381.27461410.0013
Looping result0.00100.44581390.0000
Template Total0.220195.010.2201
Template load0.00070.283910.0007
Template processing0.219494.708810.2194
Override
Cache load0.00040.178210.0004
Sytem overhead
Fetch class attribute can translate value0.00070.302110.0007
XML
Image XML parsing0.00030.116610.0003
General
dbfile0.00964.1624200.0005
String conversion0.00000.001930.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs