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
ACustomEdit: TCustomEdit absolute AWinControl;
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))
else
TWin32WSWinControl.SetText(ACustomEdit, AText);