OSDN Git Service

2005-03-17 Robert Dewar <dewar@adacore.com>
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 18 Mar 2005 11:50:30 +0000 (11:50 +0000)
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 18 Mar 2005 11:50:30 +0000 (11:50 +0000)
PR ada/19519

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

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@96671 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ada/namet.adb

index d462d11..b10696d 100644 (file)
@@ -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)