On Thu, 08 Oct 2009, Szak�ts Viktor wrote:
>> I do not understand what is the problem in your case but for sure
>> above does not discribe GTWVT behvior.
>> For both UNICODE and non UNICODE modes all you should use:
>> hb_setTermCP( <cTermCP>, <cHostCP> )
>> where <cTermCP> is OS encoding and <cHostCP> is HVM encoding.
>> When <cHostCP> is not given then _SET_CODEPAGE is used.
>> The only one difference between UNICODE and non UNICODE mode
>> is the fact that in UNICODE mode <cTermCP> is ignored and only
>> <cHostCP> is significant but for user code it does not create
>> any differences.
> Yes, sorry, I mixed the cases, it's ignored in UNICODE and
> not ignored in UNICODE as you say.
> It means I have to manually adjust CP setup for each platform,
> build type and active GT (even WINE, but that's probably not
> Harbour's fault). GTWIN works differently than GTWVT,
??? I do not see any difference and I still do not understand what
is the problem. In UNICODE builds we do not have to know OS character
encoding. Just simply such knowledge is unnecessary for us because
we are exchange data between OS using UNICODE characters.
In non unicode builds we have to set valid OS CP used by font
and/or keyboard input. Here default setting depends on country
and user locale settings.
> GTWVT works differently in UNICODE and non-UNICODE mode, and
> things work a little bit differently with other GTs. Things
> will be a bit more complicated on Windows, after my app switched
> to ISO CP from DOS.
Can you explain precisely what's the difference for you?
I.e. some small self contain example.
> Now I had to drop hb_setTermCP() as it seems dangerous in
> portable code. Instead I'm adjusting DispCP and KeyCP separately
> depending on above factors. KeyCP is only set on *nix systems.
> Plus HB_GTI_CODEPAGE on win when ISO CP is used. I didn't
> test UNICODE mode in this scenario yet.
WIN CP settings are ignored in UNICODE builds.
> For me this is a little confusing. Prone to break easily.
For me hb_set{Term,Disp,Key}CP() works perfectly and I do not
see any thing wrong in portability. In general I still do not
understand what is your problem.
Self contain examples will make things more precise.
Probably I'm missing sth important for you.
best regards,
Przemek
_______________________________________________
Harbour mailing list
[email protected]
http://lists.harbour-project.org/mailman/listinfo/harbour