In non unicode builds it can be used only for character translations
but it cannot change font encoding. It can be done only using MS CP
number with HB_GTI_CODEPAGE though if someone has a while then he
can create function which will translate our unicode CPs to MS CP
numbers and we can use it inside SETDISPCP() method to automatically
set font encoding in non unicode GTWIN and GTWVT builds.

I have this code:
---
     IF hb_GTInfo( HB_GTI_ISGRAPHIC )
          // GTWVT
          SWITCH Upper( hb_cdpUniID( app[_APP_cNatCP] ) )
          CASE "ISO8859-2"
CASE "CP1250" ; hb_gtInfo( HB_GTI_CODEPAGE, 238 ) /* EASTEUROPE_CHARSET */ ; EXIT
          CASE "ISO8859-5"
CASE "CP1251" ; hb_gtInfo( HB_GTI_CODEPAGE, 204 ) /* RUSSIAN_CHARSET */ ; EXIT
          CASE "ISO8859-1"
CASE "CP1252" ; hb_gtInfo( HB_GTI_CODEPAGE, 0 ) /* ANSI_CHARSET */ ; EXIT CASE "CP1253" ; hb_gtInfo( HB_GTI_CODEPAGE, 161 ) /* GREEK_CHARSET */ ; EXIT CASE "CP1254" ; hb_gtInfo( HB_GTI_CODEPAGE, 162 ) /* TURKISH_CHARSET */ ; EXIT CASE "CP1255" ; hb_gtInfo( HB_GTI_CODEPAGE, 177 ) /* HEBREW_CHARSET */ ; EXIT CASE "CP1256" ; hb_gtInfo( HB_GTI_CODEPAGE, 178 ) /* ARABIC_CHARSET */ ; EXIT CASE "CP1257" ; hb_gtInfo( HB_GTI_CODEPAGE, 186 ) /* BALTIC_CHARSET */ ; EXIT CASE "CP1258" ; hb_gtInfo( HB_GTI_CODEPAGE, 163 ) /* VIETNAMESE_CHARSET */ ; EXIT CASE "CP874" ; hb_gtInfo( HB_GTI_CODEPAGE, 222 ) /* THAI_CHARSET */ ; EXIT OTHERWISE ; hb_gtInfo( HB_GTI_CODEPAGE, 255 ) /* OEM_CHARSET */
          ENDSWITCH
     ELSE
          // GTWIN
          SWITCH Upper( hb_cdpUniID( app[_APP_cNatCP] ) )
          CASE "ISO8859-2"
CASE "CP1250" ; hb_gtInfo( HB_GTI_CODEPAGE, 1250 ) /* EASTEUROPE_CHARSET */ ; EXIT
          CASE "ISO8859-5"
CASE "CP1251" ; hb_gtInfo( HB_GTI_CODEPAGE, 1251 ) /* RUSSIAN_CHARSET */ ; EXIT
          CASE "ISO8859-1"
CASE "CP1252" ; hb_gtInfo( HB_GTI_CODEPAGE, 1252 ) /* ANSI_CHARSET */ ; EXIT OTHERWISE ; hb_gtInfo( HB_GTI_CODEPAGE, 852 ) /* OEM_CHARSET */
          ENDSWITCH
     ENDIF
---

The downside with this solution is that it cannot be complete, as
f.e. 852 CP isn't supported in GTWVT mode (due to Windows API
limits). Could be of course that it can be done, but I missed it.

With GTWIN the remaining problems are HB_GTI_WINTITLE
CP in UNICODE mode (I didn't report this before), plus the

I guess you are talking about national characters but it's
general problem which should be covered globally for all
windows Unicode translation inside common/hbwince.c which
should respect HVM CP.
As temporary workaround you can add additional translation
using _SET_OSCODEPAGE so it will work like for file names.

Thanks. I'm already doing such translation, but it seems difficult
to get it right from .prg level for different builds. I'm now
doing a DOS to WIN CP conversion, where WIN CP equals to
_SET_OSCODEPAGE. Maybe my implementation has bugs.

Also WIN_RUNDETACHED() and WAPI_SHELLEXECUTE() needs OS CP
conversion.

high level drawing (seemingly window related) problem. I'll
try to make tests with 32-bit UNICODE to check what exactly
enables this.

AFAIK Windows does not use 32-bit UNICODE values and support only U16.
What is the exact problem?

Sorry I was talking about Win32 UNICODE build.

The screen is just messed up, menus are drawn in wrong windows,
window titles are written onto wrong windows, window width
is wrongly detected, so the menu is wrapped. These sorts of
things.

I have now the logic for MSVC 2008 UNICODE defaulting in place,
so I'll rebuild MSVC 32-bit component chain.

Brgds,
Viktor

_______________________________________________
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to