]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/contrib/strutl.cc
imbue datetime parsing with C.UTF-8 locale
[apt.git] / apt-pkg / contrib / strutl.cc
index 23c2f78e55a5dc2a2844e2d390a9a81daa960b35..ca924e578a299be7ac04b8a0b868ebc7117e634d 100644 (file)
@@ -934,6 +934,8 @@ bool RFC1123StrToTime(const char* const str,time_t &time)
    signed int year = 0; // yes, Y23K problem – we gonna worry then…
    std::string weekday, month, datespec, timespec, zone;
    std::istringstream ss(str);
+   auto const &posix = std::locale("C.UTF-8");
+   ss.imbue(posix);
    ss >> weekday;
    // we only superficially check weekday, mostly to avoid accepting localized
    // weekdays here and take only its length to decide which datetime format we