You are here

function ExifPHPExtension::_exif_reencode_to_utf8 in Exif 7

1 call to ExifPHPExtension::_exif_reencode_to_utf8()
ExifPHPExtension::_reformat in ./ExifPHPExtension.php
Helper function to reformat fields where required.

File

./ExifPHPExtension.php, line 195

Class

ExifPHPExtension

Namespace

Drupal\exif

Code

function _exif_reencode_to_utf8($value) {
  $unicode_list = unpack("v*", $value);
  $result = "";
  foreach ($unicode_list as $key => $value) {
    if ($value != 0) {
      $one_character = pack("C", $value);
      $temp = mb_convert_encoding('&#' . $value . ';', 'UTF-8', 'HTML-ENTITIES');
      $result .= $temp;
    }
  }
  return $result;
}