Alexander Grund
2690f0c363
Improve doc and naming of UTF-16 surrogate handling in generic_codecvt.
2025-10-28 20:36:15 +01:00
Alexander Grund
e540a63c0b
Enable char8_t strings where available, remove Clang condition
...
The issue was caused by using an incompatible libstdc++.
For Clang 13 & 14 libstdc++ 11 works.
2025-01-10 13:33:10 +01:00
Alexander Grund
c2147f6486
Switch to boost::core::string_view
...
This is compatible to `std::string_view` and also to `boost::string_view`
so hence the better option.
2025-01-10 13:33:09 +01:00
Alexander Grund
b919614216
Move try_to_int to extra header
2025-01-10 13:33:03 +01:00
Alexander Grund
f57605e8dc
Avoid superflous copy of time zone string
2025-01-10 12:51:47 +01:00
Alexander Grund
6826cca159
Consistently pass string_view by value
2025-01-10 12:51:47 +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
397f013506
Remove copy operators from generator
...
`hold_ptr` already ensures the proper semantic.
2024-12-01 18:55:31 +01:00
Alexander Grund
ff917062e5
Fix typo in preprocessor guard
...
Also add copyright notice for previous changes.
Fixes #239
2024-09-13 09:06:22 +02:00
Alexander Grund
fd3f9e80eb
Disambiguate new overloads
2024-07-02 20:22:02 +02:00
Alexander Grund
787cc4d2e0
Allow passing an allocator without specifying the conversion method
...
Add overloads without the method type such that the allocator can be
directly passed.
2024-07-02 19:01:14 +02:00
Alexander Grund
b33ddcfebe
Fix typo in doc
2024-07-02 19:01:14 +02:00
Alexander Grund
659a8d6f10
Improve doc for utf_to_utf string overload
...
Exclude the enable if condition only required for disambuigating between
first and 2nd overload.
2024-07-02 19:01:14 +02:00
Alexander Grund
e6a19fa064
Allow passing allocator for the string-overload of utf_to_utf
2024-07-02 19:01:14 +02:00
Alexander Grund
2c1e0a8f27
Rename typename TAlloc -> class Alloc
...
The `T`-prefix isn't used for the other template arguments
and as the allocator is always a non-trivial type `class` is more
appropriate similar to other code.
2024-07-02 19:01:14 +02:00
Alexander Grund
c9168d7d1b
Reduce noise from templates
...
Use template aliases to make templates shorter and easier to read.
Use `std::back_inserter` to avoid repeating the string type
2024-07-02 19:01:14 +02:00
Alexander Grund
6ddae0ae4f
Format sources
2024-07-02 16:26:27 +02:00
Beosar
308a18b215
Fixed compile error in C++20
...
Did not compile if called like boost::locale::conv::utf_to_utf<char32_t, char, std::allocator<char32_t>>("hello world"); because the third overload would be instantiated and not used by the compiler because the second overload fits better, yet the unused function still triggers a static_assert.
2024-05-30 03:04:05 +02:00
Beosar
cda82e879e
Implemented proper support for allocators
...
Can now automatically deduce allocators when a std::basic_string is supplied. Added optional parameter "alloc" for the other 2 functions.
2024-05-29 23:07:21 +02:00
Beosar
e9cf9a1b35
Added support for custom allocators to boost::locale::conv::utf_to_utf
2024-05-27 19:38:58 +02:00
Alexander Grund
f29d950d80
Fix type confusion with boost::locale::collator
...
The class derived from `std::collate` which is always present in `std::locale`.
So checks for the `boost::locale::collator` facet may return wrongly true.
As a fix make this an independent facet with its own ID.
Use an adapter such that a std::collate derived class can use its abilities.
2024-02-07 20:14:39 +01:00
Alexander Grund
f3be6c8f0b
Fix comparator throwing behavior
...
As documented this should throw on construction not on use.
2024-02-07 18:06:34 +01:00
Alexander Grund
4fc8ed6458
Fix documentation of collator
...
The default level is "identical" not "primary".
Also fix some typos in the documentation.
2024-02-07 18:05:50 +01:00
Alexander Grund
c5e8f02c90
Reimplement string_set as any_string
...
Use a better name for a type-erased string implemented using
`dynamic_cast` instead of storing&comparing the `typeid` of the char
type used.
This is a workaround for missing typeinfo for `char8_t` on e.g. libc++
on FreeBSD 13.1.
It also simplifies memory management size calc/copy implementation.
2024-01-24 19:07:10 +01:00
Alexander Grund
68f5cd0054
Fix a warning on Clang
2023-11-03 19:49:07 +01:00
Alexander Grund
5080ef2fe3
Use std::array in date_time_period_set
...
Avoids the magic number
2023-10-13 11:59:55 +02:00
Alexander Grund
9160e35d52
Add test for date_time_period_set
2023-10-13 11:45:15 +02:00
Alexander Grund
929fcfec62
Add test for auto-formatting date_time
2023-10-13 11:20:11 +02:00
Alexander Grund
034dae9c77
Test the base_converter (ASCII implementation as fallback)
2023-10-13 10:54:50 +02:00
Alexander Grund
9a4446aafa
Add tests for hold_ptr
2023-10-13 09:59:39 +02:00
Alexander Grund
bea86a3d2e
Implement hold_ptr::swap with exchange
2023-10-11 13:13:39 +02:00
Alexander Grund
277cf09062
Provide ADL swap for date_time
2023-10-10 18:45:03 +02:00
Alexander Grund
c68c5c7a2b
Fix handling of escaped opening brace in format strings
...
When using an escaped opening brace in a format string it was output 2
times instead of one.
Fix and add test
2023-09-19 10:51:59 +02:00
Alexander Grund
9b00ac4eb5
Fix typo string_propery/string_property
2023-09-16 17:13:39 +02:00
Alexander Grund
908b2744b4
Workaround bug in Clang < 15.x
2023-09-13 16:56:53 +02:00
Alexander Grund
324a66752b
Use dedicated macro to check availability of std::basic_string<char8_t>
...
Allow to disable for non-conforming compilers/stdlibs
2023-09-13 09:20:05 +02:00
Alexander Grund
efed993fae
Check for availability of std::string<char8_t>
2023-09-12 13:18:28 +02:00
Alexander Grund
238ba9e2e9
Remove support for codecvt<char8_t
...
std libraries don't provide the required support
(e.g. missing VTables or facet IDs)
2023-09-12 10:07:45 +02:00
Alexander Grund
6150435487
Check for std-library support for std::codecvt<char8_t
2023-09-12 10:07:45 +02:00
Alexander Grund
0faa3c10cc
Add implementations for char8_t where available
...
Allows to e.g. convert `std::u8string`s, translate them and run boundary
analysis.
Formatting isn't possible due to lack of facets
(more specifically: their IDs) in the standard libraries
2023-09-12 10:07:45 +02:00
Alexander Grund
3f1faef7aa
Fix docstrings of generic_codecvt & utf8_codecvt
2023-09-10 20:35:19 +02:00
wevsty
0552ffc29f
fix build error on MSVC
2023-08-13 21:19:01 +02:00
Alexander Grund
f28c57f09c
Replace check by assertion
...
The codepoint should always be valid at this point.
2023-07-03 14:58:05 +02:00
Alexander Grund
8421823ac9
Make from_unicode return len_or_error
...
Make it easier to understand by not reusing `codepoint`
2023-07-03 14:58:05 +02:00
Alexander Grund
6b6e656156
Fix types for to_unicode/from_unicode
...
Need to use utf::codepoint consistently.
2023-07-03 14:58:05 +02:00
Alexander Grund
2cd54e7930
Improve doc of generic_codecvt
2023-07-02 21:19:16 +02:00
Alexander Grund
5647d48ebe
Avoid copy in calendar getters
2023-06-28 23:36:30 +02:00
Alexander Grund
a4b80f9de2
Deprecate create_*_new_ptr functions and introduce helper to create a unique_ptr
...
Ownership should always be clear so remove those functions returning raw pointers.
2023-06-28 22:48:53 +02:00
Alexander Grund
5347b549b8
Deprecate adopt_backend
2023-06-28 09:16:02 +02:00
Alexander Grund
d80b3b6ebc
Refactor format parsing for better coverage and clarity
2023-06-27 23:04:09 +02:00