summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVadim Savchuk <vsavchuk@productengine.com>2010-08-04 16:52:22 +0300
committerVadim Savchuk <vsavchuk@productengine.com>2010-08-04 16:52:22 +0300
commit75e76ea248ae4674afa7ab2e3e2a018228073dc3 (patch)
treec809fdd296f5ca53b46df5a0daf68fe216f39588
parent80b37e50fac6ba84b90a918d2106449db44a5ed8 (diff)
EXT-8524 FIXED Non-ASCII character corruption in date.
Convert formatted date from system charset to UTF-8 on Windows (other OSes don't require this). See http://jira.secondlife.com/browse/EXT-8318 for more details. Reviewed by Sergey Litovchuk at https://codereview.productengine.com/secondlife/r/834/ --HG-- branch : product-engine
-rw-r--r--indra/llcommon/lldate.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/indra/llcommon/lldate.cpp b/indra/llcommon/lldate.cpp
index a7ef28b431..04583cdd4a 100644
--- a/indra/llcommon/lldate.cpp
+++ b/indra/llcommon/lldate.cpp
@@ -121,7 +121,12 @@ std::string LLDate::toHTTPDateString (tm * gmt, std::string fmt)
// use strftime() as it appears to be faster than std::time_put
char buffer[128];
strftime(buffer, 128, fmt.c_str(), gmt);
- return std::string(buffer);
+ std::string res(buffer);
+#if LL_WINDOWS
+ // Convert from locale-dependant charset to UTF-8 (EXT-8524).
+ res = ll_convert_string_to_utf8_string(res);
+#endif
+ return res;
}
void LLDate::toStream(std::ostream& s) const