Index: utffile.cpp =================================================================== RCS file: /projects/pgadmin3/src/utils/utffile.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -Lsrc/utils/utffile.cpp -Lsrc/utils/utffile.cpp -u -w -r1.8 -r1.9 --- src/utils/utffile.cpp +++ src/utils/utffile.cpp @@ -83,7 +83,12 @@ if (decr) Seek(-decr, wxFromCurrent); - m_conversion->MB2WC((wchar_t*)(wxChar*)wxStringBuffer(str, nLen), (const char*)buffer, (size_t)(nLen+1)); +#if wxUSE_UNICODE + size_t buf_len = nLen; +#else + size_t buf_len = nLen * sizeof(wchar_t); +#endif + m_conversion->MB2WC((wchar_t*)(wxChar*)wxStringBuffer(str, buf_len), (const char*)buffer, (size_t)(nLen+1)); } else str = (wxChar*)buffer;