Convert a specified number of ANSI characters in a source buffer to a buffer of corresponding OEM characters.
XSharp.RT (in XSharp.RT.dll) Version: 2.17
Syntax Request Example
pszTarget AS PSZ,
pszSource AS PSZ,
dwCount AS DWORD
) AS PSZ
public static Psz Ansi2OemBuff(
- Type: Psz
A pointer to the buffer that will contain the converted string.
- Type: Psz
A pointer to the buffer that contains the string to convert.
- Type: DWord
The number of characters to convert.
A pointer to the buffer that contains the converted string.
Ansi2OemBuff() is similar to Ansi2Oem(), except that the resulting string is stored in the buffer pointed to by pszTarget
Also, the dwCount
argument lets you specify the number of characters to be converted.
You are responsible for allocating space for the buffer pointed to by pszTarget.|
Using an unallocated buffer pointer can have adverse results.
The PSZ type is included in the X# language and runtime for compatibility only.
In most cases the type can and should be replaced with normal strings. |
If you need to interface with Win32 API functions that expect an ansi string, there is often also
an alternative with a unicode string. We recommend to use that alternative when possible.
This example uses Ansi2OemBuff() to convert the contents of the ANSI string "ßä" to the OEM character set. Note that the source string is also used as a target string:
1LOCAL cStr := "ßä"
2Ansi2OemBuff(PSZ(_CAST, cStr), PSZ(_CAST, cStr), SLen(cStr))