From 32b8d99f3e72854746e4bc5051571e46547e44f1 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Sun, 15 Nov 2026 08:51:33 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Report=20the=20encoded=20size=20?= =?UTF-8?q?of=20localization=20entries?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit GetSize counted characters while serialization writes UTF-8 bytes, desynchronizing any offset arithmetic for non-ASCII text. --- UOLib/ULocalization.pas | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/UOLib/ULocalization.pas b/UOLib/ULocalization.pas index 4946e51..c3c55ff 100644 --- a/UOLib/ULocalization.pas +++ b/UOLib/ULocalization.pas @@ -85,7 +85,8 @@ end; function TLocalizationEntry.GetSize: Integer; begin - Result := SizeOf(Integer) + SizeOf(Byte) + SizeOf(SmallInt) + Length(FText); + Result := SizeOf(Integer) + SizeOf(Byte) + SizeOf(SmallInt) + + Length(UTF8Encode(FText)); end; end.