DOMPDF的utf-8字符换行问题
2017-04-13 02:11
459 查看
找到dompdf\include下的text_frame_reflower.cls.PHP文件:
DOMPDF负责渲染文本的text_frame_reflower.cls.php文件,把以空格、分隔符为界的分割模式,修改为以一个utf-8字符为界的分隔模式。
将此代码:
[php] view
plain copy
// ........text_frame_reflower.cls.php ........
// split the text into words
$words = preg_split('/([\s-]+)/u', $text, -1, PREG_SPLIT_DELIM_CAPTURE);
$wc = count($words);
// ...............................................
换成:
[php] view
plain copy
// ........text_frame_reflower.cls.php ........
// split the text into words
preg_match_all("/./u", $text, $array);
$words = array(0);
$wc = count($words);
// ...............................................
// ........text_frame_reflower.cls.php 第50行........
// split the text into words
preg_match_all("/./u", $text, $array);
$words = array[0];
$wc = count($words);
// ...............................................
DOMPDF负责渲染文本的text_frame_reflower.cls.php文件,把以空格、分隔符为界的分割模式,修改为以一个utf-8字符为界的分隔模式。
将此代码:
[php] view
plain copy
// ........text_frame_reflower.cls.php ........
// split the text into words
$words = preg_split('/([\s-]+)/u', $text, -1, PREG_SPLIT_DELIM_CAPTURE);
$wc = count($words);
// ...............................................
换成:
[php] view
plain copy
// ........text_frame_reflower.cls.php ........
// split the text into words
preg_match_all("/./u", $text, $array);
$words = array(0);
$wc = count($words);
// ...............................................
// ........text_frame_reflower.cls.php 第50行........
// split the text into words
preg_match_all("/./u", $text, $array);
$words = array[0];
$wc = count($words);
// ...............................................
相关文章推荐
- DOMPDF的utf-8字符换行问题
- 关于 FPDF、HTML2PDF里的中文、日文、韩文等双字节字符换行问题
- java格式化字符串,在指定位置插入指定字符串,兼容中英文以及特殊字符,例如:换行,用于解决生成pdf换行问题等问题
- java格式化字符串,在指定位置插入指定字符串,兼容中英文以及特殊字符,例如:换行,用于解决生成pdf换行问题等问题
- php fpdf 报表支持gb2312、utf-8插件 支持单元格换行 有实例
- PHP截取UTF-8字符串,解决半字符问题
- 自动换行问题,而连续的数字和英文字符常常将容器撑大,下面介绍的是CSS如何实现换行的方法
- 连续字符的换行问题
- smarty截取中文字符乱码问题?gb2312-------utf-8
- Linux下查看是否有回车字符(回车换行问题):
- php fpdf 报表支持gb2312、utf-8插件 支持单元格换行 有实例
- 在php中使用mb_substr($row['title'],0,15,'utf-8')解决获取的字符后面几们的乱码问题
- freemarker生成pdf时候td中不换行的问题 生成pdf时模板中引入图片路径问题
- php smarty截取中文字符乱码问题?gb2312/utf-8
- 解决source命令导入 带utf-8字符的.sql 产生乱码的问题
- [转]UTF-8到GBK转码的特殊字符问题
- 长串连续英文字符换行问题
- 在php中使用mb_substr($row['title'],0,15,'utf-8')解决获取的字符后面几们的乱码问题
- FOP生成PDF时的中文换行问题
- about__ Flex 里 TextArea 字符换行问题。