Commit 7b8ee2f6 by Robert Dewar Committed by Arnaud Charlet

re PR ada/19519 (GNAT Bug Box when reading a program with UTF-8 encoded enumeration literals)

2005-03-17  Robert Dewar  <dewar@adacore.com>

	PR ada/19519

	* namet.adb (Copy_One_Character): Set proper wide character encoding
	for upper half character if we have upper half encoding.

From-SVN: r96671
parent e50713c0
......@@ -36,6 +36,7 @@
-- which is created manually from namet.ads and namet.adb.
with Debug; use Debug;
with Opt; use Opt;
with Output; use Output;
with Tree_IO; use Tree_IO;
with Widechar; use Widechar;
......@@ -299,7 +300,20 @@ package body Namet is
and then Name_Buffer (Old + 1) /= '_'
then
Old := Old + 1;
Insert_Character (Character'Val (Hex (2)));
-- If we have upper half encoding, then we have to set an
-- appropriate wide character sequence for this character.
if Upper_Half_Encoding then
Widechar.Set_Wide (Char_Code (Hex (2)), New_Buf, New_Len);
-- For other encoding methods, upper half characters can
-- simply use their normal representation.
else
Insert_Character (Character'Val (Hex (2)));
end if;
-- WW (wide wide character insertion)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment