Recent

Author Topic: Lazarus doesn't let me write in spanish áéíóú and ^  (Read 10730 times)

edgarrod71

  • Jr. Member
  • **
  • Posts: 68
Re: Lazarus doesn't let me write in spanish áéíóú and ^
« Reply #15 on: February 19, 2023, 01:03:23 am »
Bogen85: Yes!, actually Visual Studio on Big Sur works ok, it writes all utf-8 international letters, even I tried russian and it works! (So nothing dealing with the OS)

Meanwhile I'm working on El Capitan with Lazarus v. 2.0.12 on 64bits compilations, because that IDE works fine.  So, the code made to compile the Laz IDE for v. 2.0.12 is working ok, but they made a change so in the new OS that blocks international keys.

lainz

  • Hero Member
  • *****
  • Posts: 4738
  • Web, Desktop & Android developer
    • https://lainz.github.io/
Re: Lazarus doesn't let me write in spanish áéíóú and ^
« Reply #16 on: February 19, 2023, 03:46:13 am »
I have the same problem on MacOS. Keys that are not directly converted to characters, as ^ ´ and ¨ are not taken into account.

Thanks.

Who will report it?

circular

  • Hero Member
  • *****
  • Posts: 4450
    • Personal webpage
Re: Lazarus doesn't let me write in spanish áéíóú and ^
« Reply #17 on: February 19, 2023, 08:56:38 am »
I found an issue that may indirectly solve it:
https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/40008

I've added a comment asking about it.
Conscience is the debugger of the mind

Zath

  • Sr. Member
  • ****
  • Posts: 391
Re: Lazarus doesn't let me write in spanish áéíóú and ^
« Reply #18 on: February 19, 2023, 12:27:36 pm »
My Win10 Rad Studio 11 handles this easily and runs.
My Lazarus 2.2.0RC1 r65419 FPC 3.2.2 x86_64-win64-win32/win64 fails, highlighting non standard characters.

I cut and pasted into both as my keyboard isnt set up for the letters although happily accepts alt+0241 for the ñ etc.

The Lazarus compiler hasn't moved with the times its seems.

Code: Pascal  [Select][+][-]
  1. procedure TForm1.Button1Click(Sender: TObject);
  2. var ñandú : string; ñandú2 : integer;
  3. begin
  4. ñandú := 'ñoñerías';
  5. ñandú2 := 281;
  6. Label1.Caption:=ñandú;
  7. Edit1.Text:= inttostr(ñandú2*ñandú2);
  8. end;
  9.  
  10. end.
  11.  

I know this doesn't address the mac issue but thought I'd throw it in for info's sake.

Bogen85

  • Hero Member
  • *****
  • Posts: 703
Re: Lazarus doesn't let me write in spanish áéíóú and ^
« Reply #19 on: February 19, 2023, 12:51:09 pm »
My Win10 Rad Studio 11 handles this easily and runs.
My Lazarus 2.2.0RC1 r65419 FPC 3.2.2 x86_64-win64-win32/win64 fails, highlighting non standard characters.

I cut and pasted into both as my keyboard isnt set up for the letters although happily accepts alt+0241 for the ñ etc.

The Lazarus compiler hasn't moved with the times its seems.

Code: Pascal  [Select][+][-]
  1. procedure TForm1.Button1Click(Sender: TObject);
  2. var ñandú : string; ñandú2 : integer;
  3. begin
  4. ñandú := 'ñoñerías';
  5. ñandú2 := 281;
  6. Label1.Caption:=ñandú;
  7. Edit1.Text:= inttostr(ñandú2*ñandú2);
  8. end;
  9.  
  10. end.
  11.  

I know this doesn't address the mac issue but thought I'd throw it in for info's sake.

On no platform does Lazarus (Well, Free Pascal) accept non ASCII identifiers. For string contents and comments, sure, Free Pascal does accept non ASCII characters in them.
The non ASCII identifiers issue has nothing to do with this Mac issue with Lazarus.

https://wiki.freepascal.org/Identifier#Declaration
Quote
An identifier has to consist of at least one ASCII letter or underscore. After the first character ASCII digits may follow, too. In the case of labels, pure numeric identifiers are allowed, too.

In Pascal identifiers are case-insensitive. Foo, fOO, and FoO identify the very same object. This rule applies only for Pascal code, though. Inside inline-assembler statements asm … end identifiers are case-sensitive and may have to adhere to different structures.
See also: https://www.freepascal.org/docs-html/ref/refse4.html

This is not what this topic/thread is about.


« Last Edit: February 19, 2023, 12:57:15 pm by Bogen85 »

dbannon

  • Hero Member
  • *****
  • Posts: 3558
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Lazarus doesn't let me write in spanish áéíóú and ^
« Reply #20 on: February 19, 2023, 01:06:11 pm »
......
An identifier has to consist of at least one ASCII letter or underscore. After the first character ASCII digits may follow, too.

Indeed, and I am pretty sure C has the same "limitation".

Davo
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

TRon

  • Hero Member
  • *****
  • Posts: 4377
Re: Lazarus doesn't let me write in spanish áéíóú and ^
« Reply #21 on: February 19, 2023, 01:17:14 pm »
Indeed, and I am pretty sure C has the same "limitation".
According to Microsoft (by no means an authority on the subject):
Quote
identifier:
 nondigit
 identifier nondigit
 identifier digit

nondigit: one of
 _ a b c d e f g h i j k l m n o p q r s t u v w x y z
 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

digit: one of
 0 1 2 3 4 5 6 7 8 9
Today is tomorrow's yesterday.

Bogen85

  • Hero Member
  • *****
  • Posts: 703
Re: Lazarus doesn't let me write in spanish áéíóú and ^
« Reply #22 on: February 19, 2023, 01:34:32 pm »
gcc, clang, g++, and clang++ all compile (without any warnings or errors) and run the following (without any extra compile flags):

Code: C  [Select][+][-]
  1. #include <stdio.h>
  2.  
  3. void grëéþt() {
  4.         int á = 4;
  5.         char ñame[] = "wórød";
  6.         printf("hélló %s:%d\n", ñame, á);
  7. }
  8.  
  9. int main () {
  10.         grëéþt();
  11.         return 0;
  12. }

https://en.cppreference.com/w/cpp/language/identifiers
https://en.cppreference.com/w/c/language/identifier

Both the C and C++ standards allow for non-ASCII Unicode characters in identifiers.

Bogen85

  • Hero Member
  • *****
  • Posts: 703
Re: Lazarus doesn't let me write in spanish áéíóú and ^
« Reply #23 on: February 19, 2023, 01:39:45 pm »
The Lazarus compiler hasn't moved with the times its seems.

The Free Pascal Compiler has not, you are very correct!

TRon

  • Hero Member
  • *****
  • Posts: 4377
Re: Lazarus doesn't let me write in spanish áéíóú and ^
« Reply #24 on: February 19, 2023, 01:57:50 pm »
https://en.cppreference.com/w/cpp/language/identifiers
https://en.cppreference.com/w/c/language/identifier

Both the C and C++ standards allow for non-ASCII Unicode characters in identifiers.
Ouch !  :)

I have not seen many code using it though. Which either means it is pretty uncommon for people to actually use it or I do not see enough c-code (most probably the latter).

Now whats left are the language constructs itself (preferably also translated)  ;)
Today is tomorrow's yesterday.

Thaddy

  • Hero Member
  • *****
  • Posts: 18330
  • Here stood a man who saw the Elbe and jumped it.
Re: Lazarus doesn't let me write in spanish áéíóú and ^
« Reply #25 on: February 19, 2023, 05:27:22 pm »
AFAIK that is Bogus (a blatant lie). It is allowed for literals, but not for syntactic elements.
Also in C and C++ .....
FPC already supports that (literals).
« Last Edit: February 19, 2023, 05:31:48 pm by Thaddy »
Due to censorship, I changed this to "Nelly the Elephant". Keeps the message clear.

Bogen85

  • Hero Member
  • *****
  • Posts: 703
Re: Lazarus doesn't let me write in spanish áéíóú and ^
« Reply #26 on: February 19, 2023, 06:08:30 pm »
AFAIK that is Bogus (a blatant lie). It is allowed for literals, but not for syntactic elements.
Also in C and C++ .....
FPC already supports that (literals).

If you see in https://forum.lazarus.freepascal.org/index.php/topic,62348.msg471533.html#msg471533
Reply #12 on: 18 February 2023, 14:21:13

You will see that I said that FPC supports unicode (beyond ASCII) in literals, and that Lazarus on MacOS should as well.
I know it FPC supports unicode (beyond ASCII) in comments as well.

Are you saying that the clang and gcc installed on my system are lying to me about non-ASCII being allowed in identifiers?
And that these two sites are lying?
https://en.cppreference.com/w/cpp/language/identifiers
https://en.cppreference.com/w/c/language/identifier

What is the blatant lie? Someone in this thread said C/C++ don't support non-ASCII in identifiers, so I checked.
They do, and the two sites above confirm that. (As does my example in reply #23)

I could be mistaken, it might not be me you are accusing of lying...



« Last Edit: February 19, 2023, 06:34:28 pm by Bogen85 »

Bogen85

  • Hero Member
  • *****
  • Posts: 703
Re: Lazarus doesn't let me write in spanish áéíóú and ^
« Reply #27 on: February 19, 2023, 06:13:00 pm »
The Lazarus compiler hasn't moved with the times its seems.

The Free Pascal Compiler has not, you are very correct!

I was referring to identifiers, not to literals.
Whether or not FPC "moves with the times" on identifiers is a complete non-issue for me.
I did not even say FPC needs to "move with the times" on in regards to identifiers.

« Last Edit: February 19, 2023, 06:31:56 pm by Bogen85 »

Thaddy

  • Hero Member
  • *****
  • Posts: 18330
  • Here stood a man who saw the Elbe and jumped it.
Re: Lazarus doesn't let me write in spanish áéíóú and ^
« Reply #28 on: February 19, 2023, 06:44:32 pm »
Are you saying that the clang and gcc installed on my system are lying to me about non-ASCII being allowed in identifiers?
And that these two sites are lying?I could be mistaken, it might not be me you are accusing of lying...
Both clang and C++ do not allow syntax to be written above ASCII 127. Some exotics, mostly scripting, will accept that.

 >:D >:D >:D >:D O:-) :D

You can't have diakritics in sourcecode. Period.
 
« Last Edit: February 19, 2023, 06:46:21 pm by Thaddy »
Due to censorship, I changed this to "Nelly the Elephant". Keeps the message clear.

Bogen85

  • Hero Member
  • *****
  • Posts: 703
Re: Lazarus doesn't let me write in spanish áéíóú and ^
« Reply #29 on: February 19, 2023, 06:56:09 pm »
Are you saying that the clang and gcc installed on my system are lying to me about non-ASCII being allowed in identifiers?
And that these two sites are lying?I could be mistaken, it might not be me you are accusing of lying...
Both clang and C++ do not allow syntax to be written above ASCII 127. Some exotics, mostly scripting, will accept that.

 >:D >:D >:D >:D O:-) :D

You can't have diakritics in sourcecode. Period.

https://learn.microsoft.com/en-us/cpp/cpp/identifiers-cpp?view=msvc-170
So, clang, gcc, g++, clang++, and microsoft's c++ are exotics...

Code: C  [Select][+][-]
  1. // extended_identifier.cpp
  2. // In Visual Studio, use File, Advanced Save Options to set
  3. // the file encoding to Unicode codepage 1200
  4. struct テスト         // Japanese 'test'
  5. {
  6.     void トスト() {}  // Japanese 'toast'
  7. };
  8.  
  9. int main() {
  10.     テスト \u30D1\u30F3;  // Japanese パン 'bread' in UCN form
  11.     パン.トスト();        // compiler recognizes UCN or literal form
  12. }

I don't have access to visual c++, but clang++ and g++ compile and run that without any warnings or errors.
« Last Edit: February 19, 2023, 07:01:14 pm by Bogen85 »

 

TinyPortal © 2005-2018