Explorar el Código

* reject surrogate characters when decoding UTF-8 keyboard input

git-svn-id: branches/unicodekvm@41524 -
nickysn hace 6 años
padre
commit
982a4f4c63
Se han modificado 1 ficheros con 2 adiciones y 1 borrados
  1. 2 1
      packages/rtl-console/src/unix/keyboard.pp

+ 2 - 1
packages/rtl-console/src/unix/keyboard.pp

@@ -1456,7 +1456,8 @@ var
               if not IsValidUtf8ContinuationByte(ch) then
                 exit;
               CodePoint:=(Ord(ch) and %00111111) or CodePoint;
-              if (CodePoint>=$800) and (CodePoint<=$FFFF) then
+              if ((CodePoint>=$800) and (CodePoint<=$D7FF)) or
+                 ((CodePoint>=$E000) and (CodePoint<=$FFFF)) then
                 ReadUtf8:=CodePoint;
             end;
           4:begin