*
* @brief Implementation of FileTextEncoding structure
*/
-// RCS ID line follows -- this is updated by CVS
+// ID line follows -- this is updated by SVN
// $Id$
#include "stdafx.h"
/**
* @brief Return string representation of encoding, eg "UCS-2LE", or "1252"
*/
-CString FileTextEncoding::GetName() const
+String FileTextEncoding::GetName() const
{
if (m_unicoding == ucr::UCS2LE)
return _T("UCS-2LE");
if (m_unicoding == ucr::UTF8)
return _T("UTF-8");
- CString str;
+ String str;
if (m_codepage > -1)
{
- LPTSTR s = str.GetBuffer(32);
- _sntprintf(s, 32, _T("%d"), m_codepage);
- str.ReleaseBuffer();
+ str.resize(32);
+ LPTSTR s = &*str.begin(); //GetBuffer(32);
+ int len = _sntprintf(s, 32, _T("%d"), m_codepage);
+ str.resize(len);
}
return str;
}
*
* @brief Declaration of FileTextEncoding structure
*/
-// RCS ID line follows -- this is updated by CVS
+// ID line follows -- this is updated by SVN
// $Id$
#ifndef FileTextEncoding_h_included
void Clear();
void SetCodepage(int codepage);
void SetUnicoding(int unicoding);
- CString GetName() const;
+ String GetName() const;
static int Collate(const FileTextEncoding & fte1, const FileTextEncoding & fte2);
};
}
else if (filelocLeft.encoding.m_unicoding != filelocRight.encoding.m_unicoding)
{
- CString leftEncoding = filelocLeft.encoding.GetName();
- CString rightEnicoding = filelocRight.encoding.GetName();
+ String leftEncoding = filelocLeft.encoding.GetName();
+ String rightEncoding = filelocRight.encoding.GetName();
CString msg;
- msg.Format(IDS_DIFFERENT_UNICODINGS, leftEncoding, rightEnicoding);
+ msg.Format(IDS_DIFFERENT_UNICODINGS, leftEncoding.c_str(), rightEncoding.c_str());
int msgflags = MB_OK | MB_ICONWARNING | MB_DONT_ASK_AGAIN;
// Two files with different codepages
// Warn and propose to use the default codepage for both