i am trying to construct a (test) WideString
of:
á (U+00E1 Small Letter Latin A with acute)
but using it\'s decomp
Did you try #$0301#$0061 (i.e. diacritic first)?
OK.
So #$.... only handles ASCII 8 bits constants in this version.
You can just use a workaround using 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 don't play with chars/widechars and such.
And it will also work as expected with Unicode version of Delphi.