繁体   English   中英

iconv():在 FPDF 的输入字符串中检测到土耳其语字符的非法字符

[英]iconv(): Detected an illegal character in input string in FPDF for Turkish characters

我收到一个错误 -> iconv(): 在输入字符串中检测到非法字符

这是我的代码:

require_once 'fpdf/fpdf.php';
$pdf = new FPDF();
$pdf->AddPage();
$pdf->AddFont('arial_tr','','arial_tr.php');
$pdf->AddFont('arial_tr','B','arial_tr_bold.php');
$pdf->SetFont('arial_tr','',14);
$pdf->Cell(55,5,turkce('Fatura no'),0,0);
$pdf->Cell(58,5,turkce(': A011241'),0,0);
$pdf->Cell(25,5,turkce('Tarih'),0,0);
$pdf->Cell(52,5,turkce(': 2020-16-11 12:47 AM'),0,1);
$pdf->Cell(55,5,turkce('Toplam Tutar'),0,0);
$pdf->Cell(58,5,turkce(': 1231 ₺'),0,0);
$pdf->Cell(25,5,turkce('Müşteri Adı'),0,0);
$pdf->Cell(52,5,turkce(': Tuğrul Yıldırım'),0,1);
$pdf->Line(10,30,200,30);
$pdf->Ln(30);
$pdf->Cell(55,5,turkce('Ürün Adı'),0,0);
$pdf->Cell(58,5,turkce(': Coca Cola '),0,1);
$pdf->Cell(55,5,turkce('Vergi Oranı'),0,0);
$pdf->Cell(58,5,turkce(': %18 '),0,1);
function turkce($k)
{
    return iconv('utf-8','iso-8859-9',$k);
}
$pdf->Output();

这就是我所看到的:

致命错误:未捕获异常:FPDF 错误:某些数据已经输出,无法在 C:\\xampp\\htdocs\\test4\\islemler\\fpdf\\fpdf.php:271 中发送 PDF 文件:堆栈跟踪:#0 C:\\xampp \\htdocs\\test4\\islemler\\fpdf\\fpdf.php(1060): FPDF->Error('Some data has a...') #1 C:\\xampp\\htdocs\\test4\\islemler\\fpdf\\fpdf.php( 999): FPDF->_checkoutput() #2 C:\\xampp\\htdocs\\test4\\islemler\\fpdf.php(39): FPDF->Output() #3 {main} 抛出 C:\\xampp\\htdocs\\test4 \\islemler\\fpdf\\fpdf.php 第 271 行

尝试

function turkce($k)
{
    return iconv('utf-8','iso-8859-9\\TRANSLIT',$k);
}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM