diff --git a/src/of_str.cpp b/src/of_str.cpp index 470abe4..b35632f 100644 --- a/src/of_str.cpp +++ b/src/of_str.cpp @@ -33,11 +33,11 @@ std::vector COfStr::split(const ofString& input, const ofString& delim } ofString COfStr::trim(const ofString& input) { - size_t start = input.find_first_not_of(" \t\n\r\f\v"); + size_t start = input.find_first_not_of(ofT(" \t\n\r\f\v")); if (start == std::string::npos) { - return ""; + return ofT(""); } - size_t end = input.find_last_not_of(" \t\n\r\f\v"); + size_t end = input.find_last_not_of(ofT(" \t\n\r\f\v")); return input.substr(start, end - start + 1); } } // namespace ofen diff --git a/src/of_util.cpp b/src/of_util.cpp index e355241..9a7eeaf 100644 --- a/src/of_util.cpp +++ b/src/of_util.cpp @@ -74,9 +74,15 @@ ofString OfUtil::now_time() #else localtime_r(&time_t_now, &tm_now); #endif - std::ostringstream oss; - oss << std::put_time(&tm_now, "%Y-%m-%d %H:%M:%S"); +#ifdef UNICODE_OFSTR + std::wostringstream oss; + oss << std::put_time(&tm_now, ofT("%Y-%m-%d %H:%M:%S")); return oss.str(); +#else + std::ostringstream oss; + oss << std::put_time(&tm_now, ofT("%Y-%m-%d %H:%M:%S")); + return oss.str(); +#endif } #ifdef _WIN32