formatting broken in czech (and others?)
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 25/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- cpp
- Domain
- internationalization, localization
Research direction
Start with the provided test_datetime.c reproducer and the boost::posix_time::time_facet construction using nl_langinfo(D_FMT). Run it with LANG=cs_CZ.UTF-8, then investigate how the facet handles the '-' modifier and the O/E modifiers. Done means locale formats no longer emit unsupported modifiers and the reported Czech output is corrected.
Written by the indexing model from the issue text.
Description
Using boost 1.66.0 (Fedora 28, if that matters)
#include <langinfo.h>
#include <iostream>
#include <boost/date_time/gregorian/gregorian.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>
#include <boost/date_time/local_time/local_time.hpp>
#include <boost/regex.hpp>
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.
- Dominant language
- C++
- Stars
- 70
- Forks
- 99
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from boostorg/date_time
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 1/5 Under an hour Newbie friendliness 68/100
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
All issues in boostorg/date_time
Similar issues
-
enhancement
Difficulty 1/5 Under an hour Newbie friendliness 88/100
QuantStack/git2cpp#187 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
AXERA-TECH/ax-llm#77 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
games-on-whales/wolf#509 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100