- sprintf(buf, "%s: %s\n\r", head->GetKeyString(), str->GetData());
- Write(buf, strlen(buf));
+ wxString buf;
+ buf.Printf(_T("%s: %s\n\r"), head->GetKeyString(), str->GetData());
+
+ const wxWX2MBbuf cbuf = buf.mb_str();
+ Write(cbuf, strlen(cbuf));