PHP - корейские символы не конвертируются с UTF-8

Я создаю изображение, добавляя имя к изображению, но корейский текст отображается неправильно.

Я попытался добавить <meta http-equiv="content-type" content="text/html; charset=UTF-8" /> в html, но не смог увидеть фактический текст, который 준석 김

У меня есть следующая функция, которую я вызываю с помощью ajax для создания изображения.

public function CreateMyCertificate()
    {
        if (Auth::check()) {
            $MyScratchProjects = new MyScratchProjects();

            if(ctype_digit($_POST['id'])) {
                if(isset($_POST['id']) && !empty($_POST['id'])) {
                    $DiplomaIdx = $_POST['id'];
                } else {
                    $DiplomaIdx = "0";
                }

                $GetMyDiploma = $MyScratchProjects->GetMyDiploma($DiplomaIdx);

                $CertificatePath = url().'/public/upload/diplomas/certificate/'.$GetMyDiploma[0]->CertificateTemplate; // Get certificate
                $FileExt = pathinfo($CertificatePath, PATHINFO_EXTENSION);
                $Name = $GetMyDiploma[0]->FirstName.' '.$GetMyDiploma[0]->LastName; // Get user first & last name
                $CertificateName = strtolower($GetMyDiploma[0]->Title).'-certificate'; // Get user first & last name
                //$Name = "Wonkyu Kim";
                $SourceFile = $CertificatePath;

                //Set the Content Type
                //header('Content-type: image/jpeg');

                // Copy and resample the imag
                list($Width, $Height) = getimagesize($SourceFile);
                $ImageP = imagecreatetruecolor($Width, $Height);
                if (strtolower($FileExt) == 'png') {
                    $Image = imagecreatefrompng($SourceFile);
                } else if(strtolower($FileExt) == 'jpeg') {
                    $Image = imagecreatefromjpeg($SourceFile);
                } else if(strtolower($FileExt) == 'gif') {
                    $Image = imagecreatefromgif($SourceFile);
                } else {
                    $Image = imagecreatefromjpeg($SourceFile);
                }

                imagecopyresampled($ImageP, $Image, 0, 0, 0, 0, $Width, $Height, $Width, $Height);

                // Prepare font size and colors
                $TextColor = imagecolorallocate($ImageP, 129, 112, 167);
                $BgColor = imagecolorallocate($ImageP, 129, 112, 167);
                $Font = 'resources/assets/front/fonts/Roboto-Bold-webfont.ttf';
                $FontSize = 27;

                // Set the offset x and y for the text position
                $OffsetX = 0;
                $offsetY = 20;

                // Get the size of the text area
                $Dims = imagettfbbox($FontSize, 0, $Font, $Name);
                $TextWidth = $Dims[4] - $Dims[6] + $OffsetX;
                $TextHeight = $Dims[3] - $Dims[5] + $offsetY;

                // Add text
                //imagettftext($ImageP, $FontSize, 0, $OffsetX, $offsetY, $TextColor, $Font, $text);
                imagettftext($ImageP, $FontSize, 0, 270, 215, $TextColor, $Font, $Name);

                // Save the picture
                ob_start();
                imagepng($ImageP);

                $Base64ImgData = base64_encode(ob_get_clean());

                $html = '<meta http-equiv="content-type" content="text/html; charset=UTF-8" /><div class="modal-body">
                    <div class="certificate_model_container">
                        <div class="model_inner_container">
                            <div class="find_inner_logo">
                                <img alt="edito" src="'.url().'/resources/assets/front/images/Logo_inner.png">
                                <h5>'.$GetMyDiploma[0]->Title.'</h5>
                            </div>
                            <div class="model_img_dv">';
                                $html .= '<a href="data:image/png;base64,'.$Base64ImgData.'" class="none download-my-certificate" download="'.$CertificateName.'.png"></a>';
                                $html .= '<img class="myImage" src="data:image/png;base64,'.$Base64ImgData.'"  alt="'.$GetMyDiploma[0]->Title.'">';
                                $html .= '<p>'.MyFuncs::DateFormat($GetMyDiploma[0]->AwardedOn).'</p>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="modal-footer regiter_btns img_certi_ftr">
                    <div class="find_acc_btn_contianer re_container">
                        <button class="download" type="button">'.trans('messages.my_story.download').'</button>
                        <button class="btn_2" type="button">'.trans('messages.my_story.print').'</button>
                        <button data-dismiss="modal" class="" type="button">'.trans('messages.my_story.close').'</button>
                    </div>
                </div>';

                // Clear
                imagedestroy($Image);
                imagedestroy($ImageP);

                echo $html;
            }

        }

введите здесь описание изображения


person Mr.Happy    schedule 26.04.2016    source источник