delphi - Delphi 中 WideString 的 WrapText

标签 delphi localization internationalization delphi-2007

德尔福有一个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/

相关文章:

asp.net - Idhttp +下载+ Delphi + ASP.NET

database - 如何根据内容自动调整/缩放 DBGrid(或其他类似)的列宽?

python - 生成本地化文件的最简单方法

ruby-on-rails - globalize3 和 easy_globalize3_accessors 验证

java - 开发支持多语言的java客户端时优化jar文件大小(图片)

java - 另一个 Delphi 到 Java 的移植问题

delphi - Soap Delphi 客户端因 1MB 调用超时而结束

iphone - Localized.strings 已损坏?

java - 如何本地化 java tomcat 网络服务器上的内容?

json - 我收到来自 i18n aurelia 的错误