// CharEncode.h: interface for the CCharEncode class.
//
//////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2000, 2001 Robert Cunnings. All rights reserved.
//
// You may copy, modify, distribute or publish this code free of charge.
//
// NO WARRANTY: This software is provided AS IS, without warranty of any kind.
//
//////////////////////////////////////////////////////////////////////
//
// Routines to convert from UTF-8 to Unicode and back.
// Adapted in part from the famous code by Ken Thompson of AT&T Bell Laboratories.
// 
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_CHARENCODE_H__BE37E4D3_39DF_11D4_9E68_00105AABC815__INCLUDED_)
#define AFX_CHARENCODE_H__BE37E4D3_39DF_11D4_9E68_00105AABC815__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include <string>
using namespace std;

int WideCharToUTF8(char *pszMulti, const wchar_t WideChar);
int WideStringToUTF8(const wstring& wstrSource, string& strDest);
int WideStringToUTF8(const wchar_t *pwszSource, unsigned long ulSrcLength, char **pszDest);
int WideStringToUTF8(const wchar_t *pwszSource, unsigned long ulSrcLength, string& strDest);
int UTF8ToWideChar(wchar_t *pWideChar, const char *pszMulti);
int UTF8ToWideString(const string& strSource, wstring& wstrDest);
int UTF8ToWideString(const char *pszSource, unsigned long ulSrcLength, wstring& wstrDest);

#endif // !defined(AFX_CHARENCODE_H__BE37E4D3_39DF_11D4_9E68_00105AABC815__INCLUDED_)
