win32: compare length using UTF8Length()

git-svn-id: trunk@35367 -
This commit is contained in:
paul 2012-02-15 02:37:56 +00:00
parent d76c007767
commit 69545efcb9

View File

@ -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);