Browse Source

* fixed handling of non-BMP characters in Video.ExtendedGraphemeClusterDisplayWidth

git-svn-id: branches/unicodekvm@48789 -
nickysn 4 years ago
parent
commit
c63534af48
1 changed files with 1 additions and 1 deletions
  1. 1 1
      packages/rtl-console/src/inc/video.inc

+ 1 - 1
packages/rtl-console/src/inc/video.inc

@@ -459,7 +459,7 @@ begin
       if (FirstCodePoint>=$D800) and (FirstCodePoint<=$DBFF) and (Length(EGC)>=2) and
       if (FirstCodePoint>=$D800) and (FirstCodePoint<=$DBFF) and (Length(EGC)>=2) and
          (Ord(EGC[2])>=$DC00) and (Ord(EGC[2])<=$DFFF) then
          (Ord(EGC[2])>=$DC00) and (Ord(EGC[2])<=$DFFF) then
         begin
         begin
-          FirstCodePoint := ((FirstCodePoint-$D800) shl 10) or (Ord(EGC[2])-$DC00);
+          FirstCodePoint := $10000+((FirstCodePoint-$D800) shl 10) or (Ord(EGC[2])-$DC00);
         end;
         end;
       { todo: handle emoji + modifiers }
       { todo: handle emoji + modifiers }
       case GetEastAsianWidth(FirstCodePoint) of
       case GetEastAsianWidth(FirstCodePoint) of