More Unicode fixes

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@7269 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2000-04-25 06:03:12 +00:00
parent e54cfe2b28
commit 9d98a27ad6
8 changed files with 12 additions and 12 deletions

View File

@@ -146,7 +146,7 @@ WXDLLEXPORT_DATA(extern wxMBConv *) wxConvCurrent;
// ----------------------------------------------------------------------------
// filenames are multibyte on Unix and probably widechar on Windows?
#if defined(__UNIX__) || defined(__WIN32__)
#if defined(__UNIX__) || defined(__BORLANDC__)
#define wxMBFILES 1
#else
#define wxMBFILES 0

View File

@@ -2199,7 +2199,7 @@ bool wxTransferFileToStream(const wxString& filename, wxOutputStream& stream)
FILE *fd1;
int ch;
if ((fd1 = fopen (filename.fn_str(), "rb")) == NULL)
if ((fd1 = wxFopen (filename.fn_str(), wxT("rb"))) == NULL)
return FALSE;
while ((ch = getc (fd1)) != EOF)
@@ -2214,7 +2214,7 @@ bool wxTransferStreamToFile(wxInputStream& stream, const wxString& filename)
FILE *fd1;
char ch;
if ((fd1 = fopen (filename.fn_str(), "wb")) == NULL)
if ((fd1 = wxFopen (filename.fn_str(), wxT("wb"))) == NULL)
{
return FALSE;
}

View File

@@ -1163,7 +1163,7 @@ bool wxPathExists(const wxChar *pszPathName)
/* Windows API returns -1 from stat for "c:\dir\" if "c:\dir" exists
* OTOH, we should change "d:" to "d:\" and leave "\" as is. */
wxString strPath(pszPathName);
if ( wxEndsWithPathSeparator(pszPathName) && pszPathName[1] != wxT('\0') )
if ( wxEndsWithPathSeparator(pszPathName) && pszPathName[1] != wxT('\0') && pszPathName[1] != wxT(':') )
strPath.Last() = wxT('\0');
wxStructStat st;

View File

@@ -118,7 +118,7 @@ wxString wxZipFSHandler::FindFirst(const wxString& spec, int flags)
}
m_ZipFile = left;
m_Archive = (void*) unzOpen(m_ZipFile.fn_str());
m_Archive = (void*) unzOpen(m_ZipFile.mb_str());
m_Pattern = right.AfterLast(wxT('/'));
m_BaseDir = right.BeforeLast(wxT('/'));

View File

@@ -519,7 +519,7 @@ void wxDebugContext::SetStream(ostream *str, streambuf *buf)
bool wxDebugContext::SetFile(const wxString& file)
{
ofstream *str = new ofstream(file.fn_str());
ofstream *str = new ofstream(file.mb_str());
if (str->bad())
{
@@ -1026,7 +1026,7 @@ void operator delete(void* pData, wxChar* /* fileName */, int /* lineNum */)
wxDebugFree(pData, FALSE);
}
// New operator 21/11/1998
void operator delete[](void* pData, char* /* fileName */, int /* lineNum */)
void operator delete[](void* pData, wxChar* /* fileName */, int /* lineNum */)
{
wxDebugFree(pData, TRUE);
}

View File

@@ -39,13 +39,13 @@ wxZipInputStream::wxZipInputStream(const wxString& archive, const wxString& file
m_Pos = 0;
m_Size = 0;
m_Archive = (void*) unzOpen(archive.fn_str());
m_Archive = (void*) unzOpen(archive.mb_str());
if (m_Archive == NULL)
{
m_lasterror = wxStream_READ_ERR;
return;
}
if (unzLocateFile((unzFile)m_Archive, file.fn_str(), 0) != UNZ_OK)
if (unzLocateFile((unzFile)m_Archive, file.mb_str(), 0) != UNZ_OK)
{
m_lasterror = wxStream_READ_ERR;
return;

View File

@@ -166,7 +166,7 @@ wxHTMLHelpControllerBase::LoadFile(const wxString& ifile)
m_MapList = new wxList;
m_NumOfEntries = 0;
FILE *input = fopen(mapFile.fn_str(),"rt");
FILE *input = wxFopen(mapFile.fn_str(),wxT("rt"));
if(! input)
return FALSE;
do

View File

@@ -379,12 +379,12 @@ bool wxMakeMetafilePlaceable(const wxString& filename, int x1, int y1, int x2, i
p < (WORD *)&pMFHead ->checksum; ++p)
pMFHead ->checksum ^= *p;
FILE *fd = fopen(filename.fn_str(), "rb");
FILE *fd = wxFopen(filename.fn_str(), "rb");
if (!fd) return FALSE;
wxChar tempFileBuf[256];
wxGetTempFileName(wxT("mf"), tempFileBuf);
FILE *fHandle = fopen(wxConvFile.cWX2MB(tempFileBuf), "wb");
FILE *fHandle = wxFopen(wxConvFile.cWX2MB(tempFileBuf), "wb");
if (!fHandle)
return FALSE;
fwrite((void *)&header, sizeof(unsigned char), sizeof(mfPLACEABLEHEADER), fHandle);