+ else // already in UTF-8, no conversion needed
+ {
+ return wxString(s, len != wxString::npos ? len : strlen(s));
+ }
+#endif // wxUSE_UNICODE/!wxUSE_UNICODE
+}
+
+// returns true if the given string contains only whitespaces
+bool wxIsWhiteOnly(const wxChar *buf)
+{
+ for (const wxChar *c = buf; *c != wxT('\0'); c++)
+ if (*c != wxT(' ') && *c != wxT('\t') && *c != wxT('\n') && *c != wxT('\r'))
+ return false;
+ return true;