Click or drag to resize

Ansi2OemA Function (String)

X#
Convert a string of ANSI characters to OEM characters, changing the contents of the original string as well as the returned string.

Namespace:  XSharp.Core
Assembly:  XSharp.Core (in XSharp.Core.dll) Version: 2.19
Syntax
 FUNCTION Ansi2OemA(
	cAnsiString REF STRING
) AS STRING
Request Example View Source

Parameters

cAnsiString
Type: String
A source string of ANSI characters.

Return Value

Type: String
A converted string of OEM characters.
Remarks
Ansi2OemA() is the same as Ansi2Oem(), except that Ansi2OemA() also replaces the contents of the original string with OEM characters.
Remarks
Caution note Caution
The Ansi2Oem() and Oem2Ansi() family of functions are compatibility functions. Do not use them unless you really have to. X# is a Unicode language and conversions from Unicode - Ansi - Oem - Unicode will take place if you use these functions.
You should also realize that Ansi2Oem(Oem2Ansi(cSource)) will not always return cSource. Some characters may not be available in the OEM codepage and could be translated to other characters. For example: Windows codepage 1252 has Capital E Umlaut (Ë) on position 203. When translated to OEM codepage 437 this will become capital E without umlaut (69). Converting back to Ansi this will remain a E without umlaut.
Examples
This example converts the contents of a string containing the characters ßä from ANSI to OEM.
X#
1LOCAL cString AS STRING
2cString := "ßä"
3Ansi2OEMA(cString)        // Converts ßä to OEM
See Also