문자열을 OEM 정의 문자 집합으로 변환합니다.
Syntax
BOOL CharToOemW(
[in] LPCWSTR pSrc,
[out] LPSTR pDst
);
Parameters
[in] pSrc
Type: LPCTSTR
번역할 null로 끝나는 문자열입니다.
[out] pDst
Type: LPSTR
번역된 문자열을 받는 대상 버퍼입니다. If the CharToOem function is being used as an ANSI function, the string can be translated in place by setting the lpszDst parameter to the same address as the lpszSrc parameter. This cannot be done if CharToOem is being used as a wide-character function.
Return value
Type: BOOL
The return value is always nonzero except when you pass the same address to lpszSrc and lpszDst in the wide-character version of the function. In this case the function returns zero and GetLastError returns ERROR_INVALID_ADDRESS.
Remarks
Security Considerations
이 함수를 잘못 사용하면 프로그램의 보안이 손상될 수 있습니다. For example, miscalculating the proper size of the lpszDst buffer, especially when the application is used in both ANSI and Unicode versions, can cause a buffer overflow. 자세한 내용은 보안 고려 사항: 국가별 기능 및 보안 고려 사항: Windows 사용자 인터페이스를 참조하세요.
Note
winuser.h 헤더는 UNICODE 전처리기 상수의 정의에 따라 이 함수의 ANSI 또는 유니코드 버전을 자동으로 선택하는 별칭으로 CharToOem을 정의합니다. 인코딩 중립 별칭을 인코딩 중립이 아닌 코드와 혼합하면 컴파일 또는 런타임 오류가 발생하는 불일치가 발생할 수 있습니다. 자세한 내용은 함수 프로토타입대한
Requirements
Requirement | Value |
---|---|
지원되는 최소 클라이언트 | Windows 2000 Professional [데스크톱 앱만 해당] |
지원되는 최소 서버 | Windows 2000 Server [데스크톱 앱만 해당] |
Target Platform | Windows |
Header | winuser.h(Windows.h 포함) |
Library | User32.lib |
DLL | User32.dll |
API set | ext-ms-win-ntuser-chartranslation-l1-1-0(Windows 8에서 도입) |
See also
Conceptual
Reference