OEMToANSI(), ANSIToOEM()
These functions convert text between the IBM character set and its closest equivalent in ANSI. Great way to forever and hopelessly mangle text. Use Code Pages instead. OEMTOANSI() was a great idea for U.S. translation of text from DOS to Windows before the code page support of FoxPro version 2.5a, but far better ways exist now. OEMTOANSI() converts characters 15, 20, 21 and those of values 128 and above from their values on the IBM-PC character set to their equivalents on the Windows platform, and ANSITOOEM() attempts to go the other way.That's great, you say, but what about those characters, such as line and box drawing characters, that don't have a close equivalent? Mangled right into vertical bars and plus symbols, they are, matey. Since these characters lose their original value, you cannot run the opposite function back on them and hope to come out with the original string. Use the AS clauses of functions such as MODIFY FILE or the CPConvert() function for fields.
Usage |
cRetVal = OEMTOANSI( cString ) cRetVal = ANSITOOEM( cString ) |
Example |
@ $+1,0 say OEMtoANSI("Jos"+chr(130)) font "Times",9 @ $+1,0 say ANSItoOEM("Jos�") font "FoxFont",9 |
See Also |
Asc(), Chr(), CPConvert(), CPCurrent(), CPDBF(), Modify File, Modify Command |