2

I am using the GPS to programming. But I can't use unicode characters in code. I set the Character Set as UTF-8 in preferences. But I still could not type the unicode characters as comment in the code. Can anyone tell me how to use unicode characters in source code? I will very appreciate for your assistance. Thanks!

Sun

sunny2016
  • 1,345
  • 3
  • 13
  • 22

2 Answers2

4

How ["03C0"] match <Ada Reference Manual>'s grammar in Annex P?

Maybe this question&answer can answer your question.

Which is your problem?

1. Can not type in the unicode character.
2. Can copy an unicode character but can not paste in GPS.
3. Can type or paste in GPS, but can not save.
4. Can type or paste in GPS and can save, but can not compile.

I guess your problem is the No. 4, then refer to my previous post as above link. You need to use "gnatmake -gnatW8 Hello.adb" to compile.


Goto Build | Settings | Targets | Check Syntax At the bottom insert -gnatW8 in the command field like: %gnatmake -q -gnatW8 -c -gnats -u %eL -P%PP %X %fp

So does to Check Semantic if needed.

Community
  • 1
  • 1
milesma
  • 1,561
  • 1
  • 15
  • 37
  • You can put it into the project settings, too. Project -> Edit Project Settings -> Switches tab -> Gnatmake or Ada subtab -> add `-gnatW8` to textfield at bottom. They should add a field for this (if they havn't already, I don't have newest GPS here). Pretty Printer subtab already has options for this. – Rommudoh Sep 30 '11 at 06:23
  • Thanks for you answer! My problem is: I can't type unicode characters in GPS edit fields. When I type in it, it is just show a box. – sunny2016 Sep 30 '11 at 09:51
  • The font that GPS is using lacks those Unicode characters. Look for where to change the font that GPS is using there. Change it to, say, Everson Mono (scalable) or GNU Unifont (bitmapped). – Andreas ZUERCHER May 11 '14 at 04:08
1

If you just get a box in the edit fields you need to use a different font for GUI and editing. DejaVu is a good one as it contains almost all unicode characters.

Setting them up depends a bit on your OS.

Martin
  • 11,577
  • 16
  • 80
  • 110