boostorg / boostorg/date_time

formatting broken in czech (and others?)

Open
#83 1 comment 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
C++
Stars
70
Forks
99
PR merge metrics
No merged PRs in 30d

Description

Using boost 1.66.0 (Fedora 28, if that matters)

```
#include
#include
#include
#include
#include
#include

int main(int argc, char **argv) {
namespace pt = boost::posix_time;
pt::ptime now = pt::second_clock::local_time();
using Facet = boost::posix_time::time_facet;
std::stringstream ss;
char *fmt;

setlocale(LC_ALL, "");
fmt = nl_langinfo(D_FMT);

auto output_facet(new Facet(fmt));
ss.imbue(std::locale(std::locale(), output_facet));
ss << now;
std::cout << ss.str() << std::endl;
}
```
Compile and run.

```
[notting@nostromo: ~]$ g++ -Wall -o test_datetime test_datetime.c -lboost_date_time
[notting@nostromo: ~]$ LANG=cs_CZ.UTF-8 ./test_datetime
%-d.%-m.2018
```

boost is not working properly in the presence of the `-` modifier. It also appears to ignore the `O` and `E` modifiers (used in Persian and other languages), but those at least still substitute ascii numbers properly.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.