~singpolyma/biboumi

479b7189935baa4ca9c9d2a5525bdb1fbd8b9fef — louiz’ 5 years ago 5eb5e9e
Only use the C.UTF-8 LANG value
2 files changed, 3 insertions(+), 3 deletions(-)

M CMakeLists.txt
M louloulibs/utils/time.cpp
M CMakeLists.txt => CMakeLists.txt +2 -2
@@ 331,8 331,8 @@ if(NOT DEFINED SERVICE_GROUP)
endif()
configure_file(unit/biboumi.service.cmake biboumi.service)

# The date MUST be in english format
set(ENV{LANG} "en_US.utf-8")
# Force the format of the date output
set(ENV{LANG} "C.UTF-8")
execute_process(COMMAND "date" "+%a %b %d %Y" OUTPUT_VARIABLE RPM_DATE
                OUTPUT_STRIP_TRAILING_WHITESPACE)
unset(ENV{LANG})

M louloulibs/utils/time.cpp => louloulibs/utils/time.cpp +1 -1
@@ 24,7 24,7 @@ std::time_t parse_datetime(const std::string& stamp)
  std::tm t = {};
#ifdef HAS_GET_TIME
  std::istringstream ss(stamp);
  ss.imbue(std::locale("en_US.UTF-8"));
  ss.imbue(std::locale("C.UTF-8"));

  std::string timezone;
  ss >> std::get_time(&t, format) >> timezone;