I found an important function (at least for me it is).
(attention to Dr. Claudio, I've not it seen in HMG or even at extended and probably very useful)
This function return the current OEM code page.
Recently I had a big problem, in this application, with the identification of the current code page, because the error messages in the output of HBMK2 are recorded in OEM and I could not fix it with CP as Portuguese and also due the application is used in several other languages.
For how want to test it:
Code: Select all
* Copyright 2012 Viktor Szakats
#include "hbextcdp.ch"
MsgDebug( __CPWinToCPStd( wapi_GetOEMCP() ) )
STATIC FUNCTION __CPWinToCPStd( nCPWin )
SWITCH nCPWin
CASE 65001 ; Return "utf8"
CASE 1200 ; Return "utf16"
CASE 437
CASE 737
CASE 775
CASE 850
CASE 852
CASE 855
CASE 856
CASE 857
CASE 858
CASE 860
CASE 861
CASE 862
CASE 863
CASE 864
CASE 865
CASE 866
CASE 869
CASE 874
CASE 1250
CASE 1251
CASE 1252
CASE 1253
CASE 1254
CASE 1255
CASE 1256
CASE 1257
CASE 1258 ; Return "cp" + hb_ntos( nCPWin )
CASE 28591
CASE 28592
CASE 28593
CASE 28594
CASE 28595
CASE 28596
CASE 28597
CASE 28598
CASE 28599
CASE 28603
CASE 28605 ; Return "iso8859-" + hb_ntos( nCPWin - 28590 )
CASE 20866 ; Return "koi-8"
CASE 21866 ; Return "koi-8u"
CASE 936 ; Return "GBK"
CASE 950 ; Return "CP950"
ENDSWITCH
Return Nil
Lovely, doesn't it ?