1

{capture assign=last_name}{contact.last_name}{/capture}{$last_name|upper}

I'm trying to render my contact name in uppercases with Smarty and include letters with accents.

At the bottom of this page in the the Smarty doc: https://www.smarty.net/docs/en/language.modifier.upper.tpl It is advised to use {$your_variable|@strtoupper} but {capture assign=last_name}{contact.last_name}{/capture}{$last_name|@strtoupper} doesn't work

2

You probably want mb_strtoupper. Smarty's |upper just does strtoupper - you can see this if you look in packages/smarty/plugins/modifier.upper.php.

So one way is to hack modifier.upper.php and change it to use mb_strtoupper. You can also try using {$last_name|@mb_strtoupper} but it might give you a security error.

3

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.