Answers.Body: <p>It may be because of the civicrm_contact table and it's fields are not in utf8mb4_unicode_ci collation!</p>
  <p>The <a href="https://lab.civicrm.org/extensions/uhoh" rel="nofollow noreferrer">Uh-oh extension</a> can help highlight weird db issues for you, and cv api3 System.utf8conversion can convert all your tables to utf8mb4</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-04-22T12:35:03.377Z
Answers.Text: Hi thanks for your reply! I've checked and the civicrm_contact table is correctly in utf8mb4_unicode_ci collation. Only the civi_rule tables are in utf8_general_ci which I'd assume wouldn't affect the contact table. The extension you mentioned is quite helpfull regardless, thanks for that. Any other idea what might cause my issue with the special characters?
Answers.UserDisplayName: jrock
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-04-22T12:48:09.460Z
Answers.Text: can you see the collation for first_name and custom field column of the table?
Answers.UserDisplayName: Pradeep Nayak
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-04-28T09:21:52.393Z
Answers.Text: They are both the same collation...utf8mb4_unicode_ci. It's a mystery to me why one (custom field) will display the characters correctly and the other (first_name, etc.) won't.
Answers.UserDisplayName: jrock
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-04-22T11:49:46.377Z
Answers.LastActivityDate: 2022-04-22T11:49:46.377Z
Answers.UserDisplayName: Pradeep Nayak
Body: <p>We are using a docx file for a template and are calling the API for variables like first/last name etc. As we are working with a client who has a lot of contacts with special characters in their names (ñ, é etc.) we noticed that those aren't displayed correctly if called directly with <code>first_name</code> or <code>last_name</code>, however they ARE correctly displayed if we create a custom field in which we write the first and last name values and then instead call the custom fields.
  Any idea why this could be happening?
  And is there a way to call the values directly with the characters displaying correctly?
  Our solution is quite cumbersome.
  Thank you for help in advance!</p>
  
Tags: <templates><custom-templates>
Title: Special characters in template
ThreadText: # Special characters in template
  
  (Asked by: username_0 on 2022-04-22)
  
  We are using a docx file for a template and are calling the API for variables like first/last name etc. As we are working with a client who has a lot of contacts with special characters in their names (ñ, é etc.) we noticed that those aren't displayed correctly if called directly with `first_name` or `last_name`, however they ARE correctly displayed if we create a custom field in which we write the first and last name values and then instead call the custom fields.
  Any idea why this could be happening?
  And is there a way to call the values directly with the characters displaying correctly?
  Our solution is quite cumbersome.
  Thank you for help in advance!
  
  **Tags:** templates, custom-templates
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2022-04-22. Score: 0
  
  It may be because of the civicrm\_contact table and it's fields are not in utf8mb4\_unicode\_ci collation!
  
  The [Uh-oh extension](https://lab.civicrm.org/extensions/uhoh) can help highlight weird db issues for you, and cv api3 System.utf8conversion can convert all your tables to utf8mb4
  
  > **Comments:**
  > **username_0**: Hi thanks for your reply! I've checked and the civicrm_contact table is correctly in utf8mb4_unicode_ci collation. Only the civi_rule tables are in utf8_general_ci which I'd assume wouldn't affect the contact table. The extension you mentioned is quite helpfull regardless, thanks for that. Any other idea what might cause my issue with the special characters?  
  > **username_1**: can you see the collation for first_name and custom field column of the table?  
  > **username_0**: They are both the same collation...utf8mb4_unicode_ci. It's a mystery to me why one (custom field) will display the characters correctly and the other (first_name, etc.) won't.  
  
  ---
  
  