Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2011-02

SysLocale usage

7 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Michael Van Canneyt
to ik
ik wrote
Hello, I found out that the SysLocale is only initialized on Windows. Should it be used on other OS, or is it a Windows specific variable ?

Well, the idea is that it is initialized on all OSes, but currently it is only initialized on Windows.

The necessary code is currently still missing from clocale on unix.

Michael.

Reply by email

Tomas Hajny
to Michael Van Canneyt
Michael Van Canneyt wrote 11 lines
On Sun, 20 Feb 2011, ik wrote: > Hello, > > I found out that the SysLocale is only initialized on Windows. Should it be used on other OS, > or is it a Windows specific variable ? Well, the idea is that it is initialized on all OSes, but currently it is only initialized on Windows. The necessary code is currently still missing from clocale on unix.

Are the respective identifiers used on Windows platform independent?

Tomas

Reply by email

Marco van de Voort
to Tomas Hajny

In our previous episode, Tomas Hajny said:

> The necessary code is currently still missing from clocale on unix. Are the respective identifiers used on Windows platform independent?

Looks totally windows specific to me. Probably that is the reason why clocale doesn't since you'd need large "iso-code" to Lcid tables that unnecessarily increase binary size.

Reply by email

Unknown author
to Marco van de Voort
Marco van de Voort wrote 8 lines
In our previous episode, Tomas Hajny said: >> The necessary code is currently still missing from clocale on unix. > > Are the respective identifiers used on Windows platform independent? Looks totally windows specific to me. Probably that is the reason why clocale doesn't since you'd need large "iso-code" to Lcid tables that unnecessarily increase binary size.

Not necessarily. You could just emulate the windows constants. As long as you don't rely on the actual numerical values, this is not a problem.

Michael.

Reply by email

Marco van de Voort
to Unknown author

In our previous episode, said:

Show quoted text 6 lines
> > Looks totally windows specific to me. Probably that is the reason why > clocale doesn't since you'd need large "iso-code" to Lcid tables that > unnecessarily increase binary size. Not necessarily. You could just emulate the windows constants.

Yes, you could. But as said you need tables to emulate them. And I doubt it is worth it?

As long as you don't rely on the actual numerical values, this is not a problem.

What is the use of this record then?

TSysLocale = record
{ Delphi compat fields}
DefaultLCID,
PriLangID,

    SubLangID  : Integer;
    case byte of
      { win32 names }
      1 : (FarEast: boolean; MiddleEast: Boolean);
      { real meaning }
      2 : (MBCS : boolean; RightToLeft: Boolean);
  end;

That leaves the MBCS and RightToLeft, of which MBCS has no meaning on *nix (since if that changes, a lot more has to change?)

Reply by email

ik
to Marco van de Voort
Marco van de Voort wrote 33 lines
In our previous episode, said: > > > > Looks totally windows specific to me. Probably that is the reason why > > clocale doesn't since you'd need large "iso-code" to Lcid tables that > > unnecessarily increase binary size. > > Not necessarily. You could just emulate the windows constants. Yes, you could. But as said you need tables to emulate them. And I doubt it is worth it? > As long as you don't rely on the actual numerical values, this is not a > problem. What is the use of this record then? TSysLocale = record { Delphi compat fields} DefaultLCID, PriLangID, SubLangID : Integer; case byte of { win32 names } 1 : (FarEast: boolean; MiddleEast: Boolean); { real meaning } 2 : (MBCS : boolean; RightToLeft: Boolean); end; That leaves the MBCS and RightToLeft, of which MBCS has no meaning on *nix (since if that changes, a lot more has to change?)

I do not know what is PriLangID and SubLangID are very problematic, because on Windows you can use them with Windows language code, however of other OSes they have different codes, so unless we create our own language code that is compatible to Windows it's not relevant as well. And that's will actually make what you are saying -> bloated code.

So we can safely say it is only a Delphi computability variable ? For BiDi it's easy to know (due to the language), I've just wrote something for Lazarus for it, and it's very simple after 3 days of investigation of what other languages beside Arabic and Hebrew are Bi-Directional.

FarEast and MiddleEast are country base, so there should be also some sort of table for it.

I think that beside Windows we do not really should use this variable at all. What do you think ?

Reply by email