That fixed the all caps issue:
<?php
function imap_utf8_fix($string) {
  return iconv_mime_decode($string,0,"UTF-8");
}
?>(PHP 4, PHP 5, PHP 7, PHP 8)
imap_utf8 — MIME kodlu metni UTF-8'e dönüştürür
   Belirtilen MIME kodlu mimeli_metin dizgesinin
   karakter kodlamasını, karakter kümesi libc_istemci tarafından biliniyorsa
   UTF-8'e dönüştürür, aksi takdirde belirtilen metnin kodlaması çözümlenir ama
   UTF-8'e dönüştürülmez.
  
Kodu çözülmüş ve mümkünse UTF-8'e dönüştürülmüş dizge.
Örnek 1 - imap_utf8() örneği
<?php
echo imap_utf8("Johannes =?ISO-8859-1?Q?Schl=FCter?=");
?>Yukarıdaki örnek şuna benzer bir çıktı üretir:
Johannes Schlüter
That fixed the all caps issue:
<?php
function imap_utf8_fix($string) {
  return iconv_mime_decode($string,0,"UTF-8");
}
?>Use  iconv_mime_decode();
<?php
// This yields "Subject: Prüfung Prüfung"
echo iconv_mime_decode("Subject: =?UTF-8?B?UHLDvGZ1bmcgUHLDvGZ1bmc=?=",
                       0, "ISO-8859-1");
?>
http://php.net/manual/de/function.iconv-mime-decode.php# this script are correct with the right signs remove expression
# please, ignore the later.
function decode_utf8($str){
       # paterns
           $err="(=\?.{10,13}q\?_?|\?\=)";
           $pat = "/=([0-9A-F]{2})/"; 
           $cha="'.chr(hexdec(";
       # erase null signs in string
          $str=eregi_replace($err,"",$str);
       # to decode with eval and replace
          eval("\$str='".
                  preg_replace($pat,$cha."'$1')).'",$str)
                  ."';");
        # return
           return $str;
} 
#Note: you can to reduce this script in 3 lines.