Delphi有一个WrapText功能:
function WrapText(const Line, BreakStr: string; const BreakChars: TSysCharSet; MaxCol: Integer): string;
function WrapText(const Line: string; MaxCol: Integer): string;
Run Code Online (Sandbox Code Playgroud)
现在我需要一个处理WideStrings的版本:
function WrapTextW(const Line: WideString; MaxCol: Integer): WideString;
Run Code Online (Sandbox Code Playgroud)
是否有任何此类功能已写入某处?
警告:并非每个宽字符串字符都是2字节
这就是为什么我害怕写它
更新:占用超过2个字节的字符示例:
资本拉丁W与环和cedilla
- 字节:57 00 66 03 27 03
- 在Chrome 17中呈现:
- 在Internet Explorer 9中呈现:
- 使用Segoe UI在记事本中呈现:
- 使用Consolas在记事本中呈现:
- 在浏览器中以sans-serif字体呈现:W̧̊
- 在浏览器中以
monospaced字体呈现:W??
我试图使用ADO参数化查询.执行该Command对象会引发错误:
必须声明变量'@filename'
我@filename使用CreateParameter/Append以下方式声明参数:
sql := 'INSERT INTO Sqm(Filename, data) VALUES(@filename, @data)';
command := CoCommand.Create;
command.Set_ActiveConnection(Connection.ConnectionObject);
command.Set_CommandText(sql);
command.Set_CommandType(adCmdText);
command.Parameters.Append(Command.CreateParameter('@filename', adLongVarWChar, adParamInput, -1, Filename));
command.Parameters.Append(Command.CreateParameter('@data', adLongVarWChar, adParamInput, -1, xml);
command.Execute({out}recordsAffected, EmptyParam, adCmdText or adExecuteNoRecords);
Run Code Online (Sandbox Code Playgroud)
我究竟做错了什么?