我正在学习更多关于Unicode的知识。请有人演示如何将代码点值转换为字符串,反之亦然。
例如:如何将U+0037转换为其字符或字符串表示形式,即7。
也请展示如何为ascii做这件事。例如:将 转换为其字符或字符串表示形式,这是一个空格。
发布于 2014-08-05 08:00:05
Delphi字符串已经使用Unicode (UTF16)编码,因此不需要将delphi字符串“转换”为Unicode。下面是一个示例,说明如何将nbsp (U+00A0)和'7‘(U+0037)的Unicode表示直接插入delphi字符串中:
procedure TForm1.Button1Click(Sender: TObject);
const
U_nbsp = $00A0;
U_7 = $0037;
var
S: string;
begin
S:= 'abcd' + Char(U_nbsp) + Char(U_7);
ShowMessage(S);
end;发布于 2020-08-01 09:24:00
procedure TFrm.FormCreate(Sender: TObject);
begin
TabEmoj.Text:=#$1F604;
KeyEmojisActivator.Text:=#$1F604;
Attachbutton.Text:=#$1F4CE;
VideoAudiobutton.Text:=#$1F3A5; /// MIC = #$1F3A4;
EnterButton.Text:=#$21A9;
end;
// use this. Download example on u9.byhttps://stackoverflow.com/questions/25132737
复制相似问题