Forums / Developer / Concatenating string error

Concatenating string error

Author Message

Jorge estévez

Thursday 11 December 2008 4:12:25 pm

Hello,

Inside a template I make some concatenations of strings into an array, displaying later on the composed sentence, in some cases, when I insert an accented word for example "L 20cm + Plástico + Valor 23cm" as:

{set $cadena=$cadena|insert( $cadena|count_chars(), 'L 20cm ')}
{set $cadena=$cadena|insert( $cadena|count_chars(), 'Plástico ')}
{set $cadena=$cadena|insert( $cadena|count_chars(), 'Valor 23cm')}

Being $cadena an array well defined

I get a sentence like <b>"L 20cm Plstico Valor 23cmá"</b>

The accented word displays at the end of the sentence and does not appear as part of its word.

This only happens with accented words...

Any Ideas, clues...?

Ezp 3.10

thanks

Diseño Web Cuba
Web Design Cuba
www.elfosdesign.com

André R.

Friday 12 December 2008 12:37:14 am

Insert inserts a string at a given position, never used it so no idea how it is supposed to work.

Instead I (and most others) tend to use concat for our concating needs:
http://ez.no/doc/ez_publish/technical_manual/4_0/reference/template_operators/strings/concat

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom