- int pos = header.Find("Content-Type: text/plain; charset=");
- if (pos == -1) return; // incorrectly filled Content-Type header
- pos += 34 ; /*strlen("Content-Type: text/plain; charset=")*/
- while (header[pos] != '\n') charset << header[pos++];
-
- if ((enc = wxTheFontMapper -> CharsetToEncoding(charset, FALSE)) == wxFONTENCODING_SYSTEM) return;
+ int pos = header.Find(wxT("Content-Type: text/plain; charset="));
+ if (pos == wxNOT_FOUND)
+ return; // incorrectly filled Content-Type header
+ size_t n = pos + 34; /*strlen("Content-Type: text/plain; charset=")*/
+ while (header[n] != wxT('\n'))
+ charset << header[n++];
+
+ enc = wxTheFontMapper->CharsetToEncoding(charset, FALSE);
+ if ( enc == wxFONTENCODING_SYSTEM )
+ return; // unknown encoding