Answers.Body: <p>As Demerit pointed in this comment: <a href="https://civicrm.stackexchange.com/a/39969/104">https://civicrm.stackexchange.com/a/39969/104</a></p>
  <p><code>|crmupper</code> is the expected modifier to be used. Internally it ends up using the <code>mb_stroupper</code> function.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-07-18T15:42:34.293Z
Answers.LastActivityDate: 2024-07-18T15:42:34.293Z
Answers.UserDisplayName: Francesc Bassas i Bullich
Answers.Body: <p>You probably want mb_strtoupper. Smarty's <code>|upper</code> just does strtoupper - you can see this if you look in packages/smarty/plugins/modifier.upper.php.</p>
  <p>So one way is to hack modifier.upper.php and change it to use mb_strtoupper. You can also try using <code>{$last_name|@mb_strtoupper}</code> but it might give you a security error.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-07-15T07:09:37.467Z
Answers.Text: we did a PR for this modification in code in `packages/smarty/plugins/modifier.upper.php`
Answers.UserDisplayName: Guillaume Sorel
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-07-15T14:51:29.253Z
Answers.Text: It looks like https://github.com/civicrm/civicrm-packages/pull/325 but for a better fix I would now suggest proposing something for civi core like [mb_truncate](https://github.com/civicrm/civicrm-core/blob/b6601e07a902dcffcb9c46e113c52d7020aa8066/CRM/Core/Smarty/plugins/modifier.mb_truncate.php).
Answers.UserDisplayName: Demerit
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-07-18T01:51:46.957Z
Answers.Text: See https://github.com/civicrm/civicrm-core/pull/20892
Answers.UserDisplayName: Demerit
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-07-12T19:09:35.770Z
Answers.LastActivityDate: 2021-07-12T19:09:35.770Z
Answers.UserDisplayName: Demerit
Body: <p><code>{capture assign=last_name}{contact.last_name}{/capture}{$last_name|upper}</code></p>
  <p>I'm trying to render my contact name in uppercases with Smarty and include letters with accents.</p>
  <p>At the bottom  of this page in the the Smarty doc: <a href="https://www.smarty.net/docs/en/language.modifier.upper.tpl" rel="nofollow noreferrer">https://www.smarty.net/docs/en/language.modifier.upper.tpl</a>
  It is advised to use <code>{$your_variable|@strtoupper}</code> but <code>{capture assign=last_name}{contact.last_name}{/capture}{$last_name|@strtoupper}</code> doesn't work</p>
  
Tags: <civimail><contacts><smarty>
Title: upper case in name with accents
ThreadText: # upper case in name with accents
  
  (Asked by: username_0 on 2021-07-12)
  
  `{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
  
  **Tags:** civimail, contacts, smarty
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_2 on 2021-07-12. Score: 3 | Accepted answer
  
  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.
  
  > **Comments:**
  > **username_3**: we did a PR for this modification in code in `packages/smarty/plugins/modifier.upper.php`  
  > **username_2**: It looks like https://github.com/civicrm/civicrm-packages/pull/325 but for a better fix I would now suggest proposing something for civi core like [mb_truncate](https://github.com/civicrm/civicrm-core/blob/b6601e07a902dcffcb9c46e113c52d7020aa8066/CRM/Core/Smarty/plugins/modifier.mb_truncate.php).  
  > **username_2**: See https://github.com/civicrm/civicrm-core/pull/20892  
  
  ---
  
  ### Answer by username_1 on 2024-07-18. Score: 0
  
  As username_2 pointed in this comment: <https://civicrm.stackexchange.com/a/39969/104>
  
  `|crmupper` is the expected modifier to be used. Internally it ends up using the `mb_stroupper` function.
  
  
  ---
  
  