[Ada] Convert from UTF_16 to UTF_8 fails for large values

gcc/ada/

	PR ada/95953
	* libgnat/a-suenco.adb (Convert): Fix handling of third UTF-8
	byte.
This commit is contained in:
Arnaud Charlet 2020-06-29 04:18:27 -04:00 committed by Pierre-Marie de Rodat
parent 56bedb147e
commit cfe989ca49

View File

@ -398,7 +398,7 @@ package body Ada.Strings.UTF_Encoding.Conversions is
or Shift_Right (yyyyyyyy, 4));
Result (Len + 3) :=
Character'Val
(2#10_000000# or Shift_Left (yyyyyyyy and 2#1111#, 4)
(2#10_000000# or Shift_Left (yyyyyyyy and 2#1111#, 2)
or Shift_Right (xxxxxxxx, 6));
Result (Len + 4) :=
Character'Val