diff options
author | Robert Dewar <dewar@adacore.com> | 2005-03-18 12:50:30 +0100 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2005-03-18 12:50:30 +0100 |
commit | 7b8ee2f629801241697a61ef140df073f551d330 (patch) | |
tree | ecf70d7e3f03e330ec5235afe8351127a8fadc31 /gcc/ada | |
parent | e50713c04aed8b0038e9a48bac85de389466a6b4 (diff) | |
download | gcc-7b8ee2f629801241697a61ef140df073f551d330.zip gcc-7b8ee2f629801241697a61ef140df073f551d330.tar.gz gcc-7b8ee2f629801241697a61ef140df073f551d330.tar.bz2 |
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
Diffstat (limited to 'gcc/ada')
-rw-r--r-- | gcc/ada/namet.adb | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/gcc/ada/namet.adb b/gcc/ada/namet.adb index d462d11..b10696d 100644 --- a/gcc/ada/namet.adb +++ b/gcc/ada/namet.adb @@ -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) |