The function TRxCustomRichEdit.GetTextRange(StartPos, EndPos: Longint): string; crashes, when the selected code is UNICODE
This is due to the fact UNICODE are double byte characters, and only single byte is allocated in this function.
Recommeded changes.
Change
SetLength(Result, EndPos - StartPos + 1);
to SetLength(Result, (EndPos - StartPos + 1) * 2);
Can anyone confirm and comment on it.
Cheers.
Ling
Log in to post a comment.
The function TRxCustomRichEdit.GetTextRange(StartPos, EndPos: Longint): string; crashes, when the selected code is UNICODE
This is due to the fact UNICODE are double byte characters, and only single byte is allocated in this function.
Recommeded changes.
Change
SetLength(Result, EndPos - StartPos + 1);
to
SetLength(Result, (EndPos - StartPos + 1) * 2);
Can anyone confirm and comment on it.
Cheers.
Ling