相关疑难解决方法(0)

如何在非unicode Delphi版本中构建具有diacratic的WideString?

我正在尝试构建一个(测试)WideString:

á(U + 00E1小写字母拉丁文A,急性)

但使用它的分解形式:

拉丁文小写字母A(U + 0061)结合急性加速(U + 0301)

所以我有代码片段:

var
    test: WideString;
begin
   test := #$0061#$0301;
   MessageBoxW(0, PWideChar(test), 'Character with diacratic', MB_ICONINFORMATION or MB_OK);
end;
Run Code Online (Sandbox Code Playgroud)

除了它似乎不起作用:

在此输入图像描述

可能是一个错误MessageBox,但我会继续说,它更可能是我的代码中的错误.

我尝试过的其他一些变化:

test := WideString(#$0061#$0301);


const
    SmallLetterLatinAWithAcuteDecomposed: WideString = #$0061#$0301;
test := SmallLetterLatinAWithAcuteDecomposed


test := #$0061+#$0301;  (Doesn't compile; incompatible types)


test := WideString(#$0061)+WideString(#$0301);  (Doesn't compile; crashes compiler)


test := 'a'+WideString(#$0301);  (Doesn't compile; crashes compiler)


//Arnauld's thought:
test := …
Run Code Online (Sandbox Code Playgroud)

delphi unicode delphi-5 unicode-string widestring

4
推荐指数
1
解决办法
959
查看次数

标签 统计

delphi ×1

delphi-5 ×1

unicode ×1

unicode-string ×1

widestring ×1