utf i18n override in an extention

Author Message

risto CMS user

Friday 10 February 2006 1:04:30 am

I'm bulding an extention where I need utf8 output in an xml file. its going to be used in a flash animation so I realuy don't have an alternative.

what I have atcheaved:
If I set i18n.ini.append.php to:

[CharacterSettings]
Charset=utf8

then the flash animation is perfect. The problem the is the site it self.

Its an non utf8 mysql. And I can't doo anything about it.

If I try loading

{let $classFilter = ezini( 'Classes', 'Charset', 'i18n.ini' )}

from the extention settings It dos not override the settings.

My question is:

Is this at all posible? Would you mind showing me how?

Steph A

Friday 10 February 2006 5:31:40 am

Hello.

I got just the same probelm as you do. And I have tried to solve this for a long time now. For me its either the content of the site thats getting messed up (when UFT-8) - or the xml output produces an error because its got special chars in norwegian (iso-8859-1).

Of course everything works fine in XML when using iso-8859-1 - but then the flash application messes it up because it cant read iso-8859-1 properly.... :(

Are you using the RSS feed - or have you made a new layoutmodule? *just wondering*

Steph A

Friday 10 February 2006 8:21:27 am

By the way, also tried to convert only the infected string into utf-8, with the utf_encode parameter (in template.ini)- but it seems this doesnt work either. I only get fatal error.

But, how does the existing RSS-module output UTF-8 through template code? Because I tried inserting special chars. into the feed - and load them into an .swf file with the xml-connector, and this actually worked as intended. The chars. where displayed as normal - but through the "regular" template-override system - it does not work! What to do?

Anyone please?

Steph A

Saturday 11 February 2006 9:54:06 am

I finally made it work!

Make sure your mysql-database is set to UTF-8. Change the templates (site.ini, template.ini and i18.ini). I am also using the fck-editor, and then you also must make sure that the template literal.tpl - is encoded into UTF-8. Because this made some extra unwanted symbols in the content (two questionmarks where shown) - this is probably because the template was written with another encoding, and the data corrupted due to this conversion.

Anyway, now my content is looking fine - and my flash application (with XML connector) reads the XML output just fine (with norwegian special chars.).

:D

risto CMS user

Monday 13 February 2006 12:24:07 am

well I couldent set the databes to utf-8. but I got it to work.

in template.ini.appand.php I set this variable:

PHPOperatorList[to_utf8]=utf8_encode

and in the templates I set the spesific field to:

{$node.name|to_utf8}

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 31 2025 00:41:09
Script start
Timing: Jan 31 2025 00:41:09
Module start 'layout'
Timing: Jan 31 2025 00:41:09
Module start 'content'
Timing: Jan 31 2025 00:41:09
Module end 'content'
Timing: Jan 31 2025 00:41:09
Script end

Main resources:

Total runtime0.0237 sec
Peak memory usage6,144.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0056 588.1563151.2109
Module start 'layout' 0.00560.0041 739.3672220.6875
Module start 'content' 0.00970.0123 960.05471,001.9297
Module end 'content' 0.02210.0016 1,961.984433.9922
Script end 0.0237  1,995.9766 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002912.0747140.0002
Check MTime0.00104.3542140.0001
Mysql Total
Database connection0.00062.714210.0006
Mysqli_queries0.002811.847630.0009
Looping result0.00000.055310.0000
Template Total0.00125.010.0012
Template load0.00093.759310.0009
Template processing0.00031.196810.0003
Override
Cache load0.00062.685010.0006
General
dbfile0.00020.968780.0000
String conversion0.00000.028140.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

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

Time used to render debug report: 0.0002 secs