From 524c46d2cc675767d4598480a19a1ee73657420c Mon Sep 17 00:00:00 2001 From: martin Date: Wed, 12 Oct 2011 17:00:14 +0000 Subject: [PATCH] LazUtf8: fix 2nd loop git-svn-id: trunk@32863 - --- components/lazutils/lazutf8.pas | 43 +++++++++++++++------------------ 1 file changed, 19 insertions(+), 24 deletions(-) diff --git a/components/lazutils/lazutf8.pas b/components/lazutils/lazutf8.pas index ef91ee9220..f820e6e1c8 100644 --- a/components/lazutils/lazutf8.pas +++ b/components/lazutils/lazutf8.pas @@ -1492,31 +1492,26 @@ begin inc(OutStr); end; end; - #$c3..#$E1: - begin - case c of - #$c3..#$D2: - begin - OutStr^ := c; - d := InStr[1]; // 2nd char in 2 byte utf8 - OutStr[1] := d; - inc(InStr, 2); - inc(OutStr, 2); - HandleDualByte; - if CounterDiff = 0 then break; - end; // c3..d2 - #$e1: - begin - OutStr^ := c; - d := InStr[1]; // 2nd char in 2 byte utf8 - OutStr[1] := d; - OutStr[2] := InStr[2]; - inc(InStr, 3); - inc(OutStr, 3); - HandleTripplByte; - end; + #$c3..#$D2: + begin + OutStr^ := c; + d := InStr[1]; // 2nd char in 2 byte utf8 + OutStr[1] := d; + inc(InStr, 2); + inc(OutStr, 2); + HandleDualByte; + if CounterDiff = 0 then break; + end; // c3..d2 + #$e1: + begin + OutStr^ := c; + d := InStr[1]; // 2nd char in 2 byte utf8 + OutStr[1] := d; + OutStr[2] := InStr[2]; + inc(InStr, 3); + inc(OutStr, 3); + HandleTripplByte; end; - end; else begin // Copy the character if the string was disaligned by previous changes