
 ////////////
 //
FUNCTION Charset4Dbf_(cAlias, nCodePage)
 //      Returns CHARSET_ANSI or CHARSET_OEM according to the Code Page of Dbf
 //               <cAlias>    -> alias of the dbf that will use the Charset
 //              [<nCharset>] -> existing Charset in the dbf header
 //      Current code pages codes:
 //              https://msdn.microsoft.com/pt-br/library/windows/desktop/dd317756(v=vs.85).aspx
 //
 /////
LOCAL  nCharset4Dbf
nCodepage           := (cAlias)->(DbInfo(DBFDBO_ANSI))      // Returns the Code Page existing in the header
if     (nCodepage   == 0           .or.;                    // Latin   (Xbase++ -> see XbpFont())
        nCodepage   == 255         .or.;                    // OEM     (Xbase++ -> see XbpFont())
        nCodepage   == 437         .or.;
        (nCodepage  >= 737  .and.;
         nCodepage  <= 869))
       nCharset4Dbf := CHARSET_OEM
elseif nCodePage    >= 1250        .and.;
       nCodePage    <= 1257
       nCharset4Dbf := CHARSET_ANSI
elseif nCodepage    == 1                  // Can to be used with any Charset (Xbase++ -> vide XbpFont())
       nCharset4Dbf := Set(_SET_CHARSET)
else
       nCharset4Dbf := Set(_SET_CHARSET)  // Others Code Page
endif
RETURN  nCharset4Dbf