| 328 | |
| 329 | |
| 330 | void CFileDataIO::WriteString(const wxString& str, EUtf8Str eEncode, uint8 SizeLen) |
| 331 | { |
| 332 | switch (eEncode) { |
| 333 | case utf8strRaw: |
| 334 | case utf8strOptBOM: { |
| 335 | Unicode2CharBuf s(unicode2UTF8(str)); |
| 336 | if (s.data()) { |
| 337 | WriteStringCore(s, eEncode, SizeLen); |
| 338 | break; |
| 339 | } |
| 340 | } |
| 341 | /* fall through */ |
| 342 | default: { |
| 343 | // Non UTF-8 strings are saved as Latin-1 |
| 344 | wxCharBuffer s1 = str.mb_str(wxConvISO8859_1); |
| 345 | WriteStringCore(s1, utf8strNone, SizeLen); |
| 346 | } |
| 347 | } |
| 348 | } |
| 349 | |
| 350 | |
| 351 | void CFileDataIO::WriteStringCore(const char *s, EUtf8Str eEncode, uint8 SizeLen) |