Bug #15797
closedtx_cms_layout->wordWrapper do not support multi-byte charset
100%
Description
wordWrapper use chunk_split. which will break multi-byte charset in the middle.
As a result, the db_layout.php of page will show many broken character
It should use wordwrap in CSS. But seem not supported by Firefox.
http://msdn.microsoft.com/workshop/samples/author/dhtml/refs/wordWrap.htm
my edition of it rewrite the logic.
And it assert all incoming character are UTF-8.
(someone please change it to fix)
--- CVS 1.28.2.2 ---
function wordWrapper($content,$max=50,$char=' ') { my edition ---
$array = split(' |'.chr(10),$content);
foreach($array as $val) {
if (strlen($val)>$max) {
$content=str_replace($val,substr(chunk_split($val,$max,$char),0,-1),$content);
}
}
return $content;
}
--
function wordWrapper($content,$max=50,$char=' ') {>csConvObj;
$segments=preg_split("/[\\b\r\n ]/",$content,-1,PREG_SPLIT_DELIM_CAPTURE);
$csConv=$GLOBALS['LANG']
foreach($segments as &$segment){
if(strlen($segment)>$max){ // quick check when it is really short
$s=$segment;
$segment='';
while($csConv->strlen('utf-8',$s)>$max){
// It should do better for wide character.
// but csConvObj do not provide that information,
// and browser can do wrap between wide characters
$segment.=$csConv->substr('utf-8',$s,0,$max);
$segment.="\r\n";
$s=$csConv->substr($s,$max);
}
$segment.=$s;
}
}
return implode('',$segments);
}
(issue imported from #M2819)
Updated by Oliver Hader about 13 years ago
- Status changed from New to Closed
- Target version deleted (
0) - TYPO3 Version changed from 3.8.1 to 3.8
- PHP Version deleted (
4)
The reported TYPO3 version is not supported anymore. Please open a new and updated issue if you can reproduce this behavior with the most recent TYPO3 version.
Updated by Georg Ringer over 11 years ago
- Status changed from Closed to Accepted
example is
使用される高性能計測機器やラボ用計器を生産しています。
Updated by Gerrit Code Review over 11 years ago
- Status changed from Accepted to Under Review
Patch set 1 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/22840
Updated by Gerrit Code Review over 11 years ago
Patch set 2 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/22840
Updated by Gerrit Code Review over 11 years ago
Patch set 3 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/22840
Updated by Gerrit Code Review over 11 years ago
Patch set 4 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/22840
Updated by Gerrit Code Review over 11 years ago
Patch set 1 for branch TYPO3_6-1 has been pushed to the review server.
It is available at https://review.typo3.org/22890
Updated by Georg Ringer over 11 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset f4b5aa364e05ea4b6019f3494539142e66224d2e.