gpt4 book ai didi

delphi - Delphi 中 WideString 的 WrapText

转载 作者:行者123 更新时间:2023-12-03 14:54:18 33 4
gpt4 key购买 nike

德尔福有一个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: enter image description here
  • Rendered in Internet Explorer 9: enter image description here
  • Rendered in Notepad using Segoe UI: enter image description here
  • Rendered in Notepad using Consolas: enter image description here
  • 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/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com