找源码中的 ppUtils.pas文件里TruncateWord函数
将
while ppLineTooLong(lsTruncatedWord, llWidthAvailable, lCanvas, liTabStops, lTabStopArray) and
(Length(lsTruncatedWord) > 1)do
lsTruncatedWord := Copy(lsTruncatedWord, 1, Length(lsTruncatedWord) - 1);
改为:
while ppLineTooLong(lsTruncatedWord, llWidthAvailable, lCanvas, liTabStops, lTabStopArray) and
(Length(lsTruncatedWord) > 1)do
// lsTruncatedWord := Copy(lsTruncatedWord, 1, Length(lsTruncatedWord) - 1);
//replaced by the followed
if Windows.IsDBCSLeadByte(Byte(lsTruncatedWord[Length(lsTruncatedWord)])) then
lsTruncatedWord := Copy(lsTruncatedWord, 1, Length(lsTruncatedWord) - 2)
else
lsTruncatedWord := Copy(lsTruncatedWord, 1, Length(lsTruncatedWord) - 1);
解决汉字折行乱码问题