德尔福有一个WrapText
功能:
function WrapText(const Line, BreakStr: string; const BreakChars: TSysCharSet; MaxCol: Integer): string;
function WrapText(const Line: string; MaxCol: Integer): string;
现在我需要一个处理 WideStrings 的版本:
function WrapTextW(const Line: WideString; MaxCol: Integer): WideString;
是否已经在某处编写了此类函数?
WARNING: Not every wide string character is 2-bytes
Which is why i'm afraid to write it
更新:需要超过 2 个字节来表示的字符示例:
Capital Latin W with ring and cedilla
- Bytes: 57 00 66 03 27 03
- Rendered in Chrome 17:
- Rendered in Internet Explorer 9:
- Rendered in Notepad using Segoe UI:
- Rendered in Notepad using Consolas:
- Rendered in your browser in sans-serif font: W̧̊
- Rendered in your browser in
monospaced
font:W̧̊
最佳答案
正如kobik提到的,TNT UnicodeControls有一个单元TntSysUtils
,其中包括以下功能:
function WideWrapText(const Line, BreakStr: WideString; const BreakChars: TSysCharSet;
MaxCol: Integer): WideString; overload;
function WideWrapText(const Line: WideString; MaxCol: Integer): WideString; overload;
备用下载站点是 here .
关于delphi - Delphi 中 WideString 的 WrapText,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9703491/