Title: Metadata characters encoding issue
Last modified: August 22, 2016

---

# Metadata characters encoding issue

 *  Resolved [Rafał](https://wordpress.org/support/users/ayek/)
 * (@ayek)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/metadata-characters-encoding-issue/)
 * Hi!
    Please… How to handle IPTC metadata well with NextGEN? Why special characters(
   diacritic) are all corrupted? [The same pictures goes correctly on NextGEN 1.9.13
   on my other website.]
 * [https://wordpress.org/plugins/nextgen-gallery/](https://wordpress.org/plugins/nextgen-gallery/)

Viewing 6 replies - 1 through 6 (of 6 total)

 *  Plugin Contributor [photocrati](https://wordpress.org/support/users/photocrati/)
 * (@photocrati)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/metadata-characters-encoding-issue/#post-5396077)
 * [@ayek](https://wordpress.org/support/users/ayek/) – Thanks for reporting this.
   I just tested it and this appears to be an existing issue we were not aware of.
 * I have added it to our developer notes for them to review.
 * – Cais.
 *  Thread Starter [Rafał](https://wordpress.org/support/users/ayek/)
 * (@ayek)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/metadata-characters-encoding-issue/#post-5396328)
 * …any good news?
 *  Plugin Contributor [photocrati](https://wordpress.org/support/users/photocrati/)
 * (@photocrati)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/metadata-characters-encoding-issue/#post-5396330)
 * [@ayek](https://wordpress.org/support/users/ayek/) – We’re still working on this
   and hope to have a more robust solution in our next (major) update.
 * Thanks!
 * – Cais.
 *  Thread Starter [Rafał](https://wordpress.org/support/users/ayek/)
 * (@ayek)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/metadata-characters-encoding-issue/#post-5396335)
 * I’ve applied [JIN Weijie’s fix](http://www.jinweijie.com/wordpress/fix-nextgen-gallery-iptc-encoding-error-in-chinese/),
   and it works for me.
    Found:
 *     ```
       foreach ($iptcTags as $key => $value) {
          if (isset ( $this->iptc_data[$key] ) )
             $meta[$value] = trim(utf8_encode(implode(", ", $this->iptc_data[$key])));
       }
       ```
   
 * Replaced by:
 *     ```
       foreach ($iptcTags as $key => $value) {
          if($this->iptc_data[$key])
             $meta[$value] = mb_convert_encoding(implode(', ', $this->iptc_data[$key]), 'UTF-8', 'UTF-8');
       }
       ```
   
 * Now NGG gets and displays all diacritics and other special chars as they was 
   written in IPTC meta 🙂
 *  Thread Starter [Rafał](https://wordpress.org/support/users/ayek/)
 * (@ayek)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/metadata-characters-encoding-issue/#post-5396336)
 * I haven’t checked [this solution](https://wordpress.org/support/topic/unicode-characters-in-photo-metadata),
   but looks like it makes sense, what do you think?
 * BTW: Custom sorting by date/time doesn’t work for me (v. 2.0.66.33), although
   default sorting does.
 *  Plugin Contributor [photocrati](https://wordpress.org/support/users/photocrati/)
 * (@photocrati)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/metadata-characters-encoding-issue/#post-5396337)
 * [@ayek](https://wordpress.org/support/users/ayek/) – Thanks for sharing your 
   find. I have updated our internal notes with this information. Once our developers
   have proven it out, or found a better solution we will have it included in the
   following update.
 * As to the second reference we will be looking into that as well.
 * Thanks, again!
 * – Cais.

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Metadata characters encoding issue’ is closed to new replies.

 * ![](https://ps.w.org/nextgen-gallery/assets/icon-256x256.png?rev=2083961)
 * [Photo Gallery, Sliders, Proofing and Themes - NextGEN Gallery](https://wordpress.org/plugins/nextgen-gallery/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/nextgen-gallery/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/nextgen-gallery/)
 * [Active Topics](https://wordpress.org/support/plugin/nextgen-gallery/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/nextgen-gallery/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/nextgen-gallery/reviews/)

## Tags

 * [encoding](https://wordpress.org/support/topic-tag/encoding/)
 * [iptc](https://wordpress.org/support/topic-tag/iptc/)
 * [metadata](https://wordpress.org/support/topic-tag/metadata/)

 * 6 replies
 * 2 participants
 * Last reply from: [photocrati](https://wordpress.org/support/users/photocrati/)
 * Last activity: [11 years, 5 months ago](https://wordpress.org/support/topic/metadata-characters-encoding-issue/#post-5396337)
 * Status: resolved