Have you tried # $ 0301 # $ 0061 (i.e. diacritical first)?
OK
So, # $ .... only processes 8-bit ASCII constants in this version.
You can use a workaround using the memory level:
type
TWordArray = array[1..MaxInt div SizeOf(word)-2] of word;
// start at [1], just as WideStrings
// or: TWordArray = array[0..MaxInt div SizeOf(word)-1] of word;
PWordArray = ^TWordArray;
var
test: WideString;
begin
test := '12'; // or SetLength(test,2);
PWordArray(test)[1] := $61;
PWordArray(test)[2] := $301;
MessageBoxW(0, pointer(test), 'Character with diacratic', MB_ICONINFORMATION or MB_OK);
end;
This will always work, since you are not playing with symbols / wide clocks etc.
And it will work just as expected in the Unicode Delphi version.
source
share