Recent

Author Topic: Multilanguage UpCase and LowerCase  (Read 3215 times)

munair

  • Hero Member
  • *****
  • Posts: 887
  • compiler developer @SharpBASIC
    • SharpBASIC
Re: Multilanguage UpCase and LowerCase
« Reply #30 on: June 10, 2025, 03:06:53 pm »
Lazarus and Fpc use the official tables ad verbatum so that is not the case, even false information.
If it does not work it is your fault,

No.
It's only logical.

Thaddy

  • Hero Member
  • *****
  • Posts: 19268
  • Glad to be alive.
Re: Multilanguage UpCase and LowerCase
« Reply #31 on: June 10, 2025, 04:46:14 pm »
Yes.

Examine the sources....Which you did not do.... >:D (amateur)

If you have troubles it is your fault....

I am confining this to FPC, not Lazarus, although I expect no difference.

When you get stuck, look at the sourcecode and then you can make bold remarks:
The tables are there and - to my knowledge - correct.
Otherwise they are deferred to the OS.

The tables are machine generated from the standard of course.

There is no such thing as a FreePascal or Lazarus specific implementation.
« Last Edit: June 10, 2025, 05:01:27 pm by Thaddy »
objects are fine constructs. You can even initialize them with constructors.

etrusco

  • New Member
  • *
  • Posts: 22
Re: Multilanguage UpCase and LowerCase
« Reply #32 on: June 11, 2025, 06:31:58 am »
(...)
I am confining this to FPC, not Lazarus, although I expect no difference.

(...)
The tables are machine generated from the standard of course.

There is no such thing as a FreePascal or Lazarus specific implementation.

FPC's implementation indeed seems to be generated from CLDR data (in unicodedata.pas and related includes) but the version is not documented and it's not clear how it was generated (except that the author is Inoussa Ouedraogo).
I expected AnsiUpperCase() to work, but only UnicodeUpperCase(UTF8Decode()) had an effect.

Lazarus' LazUTF8 unit is an adaptation with a single case/switch (and an extra check for 'I' if you pass 'tr' in Language parameter).

etrusco

  • New Member
  • *
  • Posts: 22
Re: Multilanguage UpCase and LowerCase
« Reply #33 on: June 11, 2025, 06:43:22 am »
If I need UpCase and LowerCase for other languages than English. Then I should implement separate function for each language or is there some ready solutions for that?

UpperCase() and LowerCase() only convert chars from A to Z. This is documented in both Delphi and FPC.

Thaddy

  • Hero Member
  • *****
  • Posts: 19268
  • Glad to be alive.
Re: Multilanguage UpCase and LowerCase
« Reply #34 on: June 11, 2025, 08:26:45 am »
objects are fine constructs. You can even initialize them with constructors.

CM630

  • Hero Member
  • *****
  • Posts: 1700
  • Не съм сигурен, че те разбирам.
    • http://sourceforge.net/u/cm630/profile/
Re: Multilanguage UpCase and LowerCase
« Reply #35 on: June 11, 2025, 10:33:35 am »
.
Лазар 4,4 32 bit (sometimes 64 bit); FPC3,2,2

munair

  • Hero Member
  • *****
  • Posts: 887
  • compiler developer @SharpBASIC
    • SharpBASIC
Re: Multilanguage UpCase and LowerCase
« Reply #36 on: June 11, 2025, 11:04:41 am »
If you have troubles it is your fault....

I am confining this to FPC, not Lazarus, although I expect no difference.

When you get stuck, look at the sourcecode and then you can make bold remarks:

You're assuming too much. I was referring specifically to LazUTF8. I ported the entire upper- /lowercase functions and I didn't "get stuck" in doing that. They simply didn't cover every language (some only partially) and my ported functions had exactly the same functionality.
It's only logical.

CM630

  • Hero Member
  • *****
  • Posts: 1700
  • Не съм сигурен, че те разбирам.
    • http://sourceforge.net/u/cm630/profile/
« Last Edit: June 11, 2025, 11:37:34 am by CM630 »
Лазар 4,4 32 bit (sometimes 64 bit); FPC3,2,2

 

TinyPortal © 2005-2018