mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-15 01:39:25 +02:00
win32: compare length using UTF8Length()
git-svn-id: trunk@35367 -
This commit is contained in:
parent
d76c007767
commit
69545efcb9
@ -1237,7 +1237,7 @@ class procedure TWin32WSCustomEdit.SetText(const AWinControl: TWinControl;
|
|||||||
var
|
var
|
||||||
ACustomEdit: TCustomEdit absolute AWinControl;
|
ACustomEdit: TCustomEdit absolute AWinControl;
|
||||||
begin
|
begin
|
||||||
if (ACustomEdit.MaxLength > 0) and (Length(AText) > ACustomEdit.MaxLength) then
|
if (ACustomEdit.MaxLength > 0) and (UTF8Length(AText) > ACustomEdit.MaxLength) then
|
||||||
TWin32WSWinControl.SetText(ACustomEdit, UTF8Copy(AText, 1, ACustomEdit.MaxLength))
|
TWin32WSWinControl.SetText(ACustomEdit, UTF8Copy(AText, 1, ACustomEdit.MaxLength))
|
||||||
else
|
else
|
||||||
TWin32WSWinControl.SetText(ACustomEdit, AText);
|
TWin32WSWinControl.SetText(ACustomEdit, AText);
|
||||||
|
Loading…
Reference in New Issue
Block a user