Alexander Grund
e8f9544352
Replace some TEST_REQUIRE
by if TEST
2025-01-10 13:33:08 +01:00
Alexander Grund
b919614216
Move try_to_int to extra header
2025-01-10 13:33:03 +01:00
Alexander Grund
5a58e65bda
Remove superflous subfolders of src
...
The shorter paths make the sources easier to navigate.
Basically revert of #99 / f44b3bb771f01fb94614260d57e1d09cdfe1cdff
after the underlying issue is resolved.
2025-01-10 12:50:45 +01:00
Alexander Grund
396ec24b58
Add support for ISO-15924 abbreviation script code to locale_data
...
The value is (currently) ignored but this allows to parse locale names
returned by ICU.
2024-12-03 12:19:04 +01:00
Alexander Grund
9a4446aafa
Add tests for hold_ptr
2023-10-13 09:59:39 +02:00
Alexander Grund
85a0c19475
Avoid uninitialized warning in test
2023-05-28 12:22:14 +02:00
Alexander Grund
6a95c82083
Simplify tests with empty_stream
...
Add a function to clear a string stream (i.e. make it empty)
and use it instead of `s.str(some-templated-empty-string)`
2023-05-26 19:35:36 +02:00
Alexander Grund
d6e6071f16
Fix build on older MinGW using std::strtol
...
MinGW-w32 with GCC 5.3.0 may not have `std::stoi` or `std::stoull`
despite claiming C++11 support.
This seems to be a configuration bug causing a missing
`_GLIBCXX_USE_C99` define.
Fix this by creating a function `try_to_int` using `std::strtol` which
is older and seemingly available there.
The `std::sto*` functions basically use that anyway so we don't loose
anything.
2023-04-08 20:45:49 +02:00
Alexander Grund
d83f590e6b
Treat en_US_POSIX as an alias for the C locale
2023-03-01 17:09:49 +01:00
Alexander Grund
17c30c55f2
Allow only M49 format in addition to ISO 3166 format for country in locale ID
...
Reject country strings which are not ASCII letters and not in M.49 format (exactly 3 digits).
Also add tests
2023-02-28 18:06:46 +01:00
Alexander Grund
a9b70f44bc
Add return value to locale_data::parse
and constructor from locale name
...
Return false or throw when parsing fails.
2023-02-18 18:56:56 +01:00
Alexander Grund
ff3eaa2a5b
Add more test cases for locale_data
2023-02-18 18:56:56 +01:00
Alexander Grund
f8412e4ed8
Add locale_data::to_string
...
Convert the passed data back to a conventional name.
Especially useful for testing/debugging.
2023-02-18 18:56:56 +01:00
Alexander Grund
f6f897b413
locale_data: Uppercase encoding
...
Yield a uniform result, e.g. UTF-8.
This now matches the documentation as previously `boost::locale::info::encoding()`
returned "utf-8" instead of the documented "UTF-8".
2023-02-18 18:56:55 +01:00
Alexander Grund
5ebbaf247f
Add test for locale_data
and refactor the parsing
2023-02-18 18:56:55 +01:00
Alexander Grund
1652f11d94
Combine BOOST_WINDOWS || __CYGWIN__
to BOOST_LOCALE_USE_WIN32_API
...
Simplify the checks
2023-01-10 14:45:07 +01:00
Alexander Grund
b593463975
Refactor get_system_locale
...
Put `GetLocaleInfoA` into a function returning a bool to make it easier
to understand.
2023-01-07 13:55:29 +01:00
Dimitrij Mijoski
f70eafb61d
Fix order of environment variables when getting system default locale
...
See https://svn.boost.org/trac10/ticket/13289
Closes #22
2023-01-05 17:37:25 +01:00
Alexander Grund
d990932943
Add test for get_system_locale
2023-01-05 17:37:25 +01:00