Changeset 294


Ignore:
Timestamp:
01/15/15 22:38:08 (7 years ago)
Author:
Maciej Komosinski
Message:

Converted string no longer includes trailing 0 (which prevented string concatenations)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpp/common/Convert.cpp

    r286 r294  
    153153        wstring wstr;
    154154        int nOffset = 0;
    155         int nDataLen = strlen(str) + 1; //including ending \0
     155        int nDataLen = strlen(str); //ending \0 is not converted, but resize() below sets the proper length of wstr
    156156        int nLenWide = MultiByteToWideChar(CP_UTF8, 0, (LPCSTR)(str + nOffset),
    157157                (int)(nDataLen - nOffset), NULL, 0);
     
    162162        {
    163163                //ASSERT(false); //some conversion error
    164                 return wstr;
     164                return wstr + L"<UTF8_CONV_ERROR>";
    165165        }
    166166        return wstr;
Note: See TracChangeset for help on using the changeset viewer.