67 lines
2.3 KiB
C
67 lines
2.3 KiB
C
|
//+------------------------------------------------------------
|
||
|
//
|
||
|
// Copyright (C) 2000, Microsoft Corporation
|
||
|
//
|
||
|
// File: CodePageConvert.h
|
||
|
//
|
||
|
// Functions:
|
||
|
// HrCodePageConvert
|
||
|
// HrCodePageConvert
|
||
|
// HrCodePageConvertFree
|
||
|
// HrCodePageConvertInternal
|
||
|
//
|
||
|
// History:
|
||
|
// aszafer 2000/03/29 created
|
||
|
//-------------------------------------------------------------
|
||
|
|
||
|
#ifndef _CODEPAGECONVERT_H_
|
||
|
#define _CODEPAGECONVERT_H_
|
||
|
|
||
|
#include "windows.h"
|
||
|
|
||
|
#define TEMPBUFFER_WCHARS 316
|
||
|
|
||
|
HRESULT HrCodePageConvert (
|
||
|
IN UINT uiSourceCodePage, // Source code page
|
||
|
IN LPSTR pszSourceString, // Source String
|
||
|
IN UINT uiTargetCodePage, // Target code page
|
||
|
OUT LPSTR pszTargetString, // p to prealloc buffer where target string is returned
|
||
|
IN int cbTargetStringBuffer); // cbytes in prealloc buffer for target string
|
||
|
|
||
|
HRESULT HrCodePageConvert (
|
||
|
IN UINT uiSourceCodePage, // Source code page
|
||
|
IN LPSTR pszSourceString, // Source string
|
||
|
IN UINT uiTargetCodePage, // Target code page
|
||
|
OUT LPSTR * ppszTargetString); // p to where target string is returned
|
||
|
|
||
|
VOID HrCodePageConvertFree (LPSTR pszTargetString); //p to memory allocated by HrCodePageConvert
|
||
|
|
||
|
HRESULT HrCodePageConvertInternal (
|
||
|
IN UINT uiSourceCodePage, // source code page
|
||
|
IN LPSTR pszSourceString, // source string
|
||
|
IN UINT uiTargetCodePage, // target code page
|
||
|
OUT LPSTR pszTargetString, // target string or NULL
|
||
|
IN int cbTargetStringBuffer, // cb in target string or 0
|
||
|
OUT LPSTR* ppszTargetString ); // NULL or p to where target string is returned
|
||
|
|
||
|
|
||
|
HRESULT HrConvertToUnicodeWithAlloc(
|
||
|
IN UINT uiSourceCodePage,
|
||
|
IN LPSTR pszSourceString,
|
||
|
OUT LPWSTR* ppwszTargetString);
|
||
|
|
||
|
HRESULT HrConvertToUnicodeWithAlloc(
|
||
|
IN UINT uiSourceCodePage,
|
||
|
IN DWORD dwcbSourceString,
|
||
|
IN LPSTR pszSourceString,
|
||
|
OUT LPWSTR* ppwszTargetString);
|
||
|
|
||
|
VOID CodePageConvertFree (
|
||
|
IN LPWSTR pwszTargetString); //p to memory allocated by ConvertToUnicodeWithAlloc
|
||
|
|
||
|
HRESULT wcsutf8cmpi(
|
||
|
IN LPWSTR pwszStr1, // two strings to compare
|
||
|
IN LPCSTR pszStr2);
|
||
|
|
||
|
#endif //_CODEPAGECONVERT_H_
|