Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge develop to master #220

Merged
merged 37 commits into from
Feb 13, 2024
Merged

Merge develop to master #220

merged 37 commits into from
Feb 13, 2024

Conversation

Flamefire
Copy link
Collaborator

No description provided.

Assert post-conditions of calling `iconv` and add test for a possible
violation of that.
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.
Including ICU might bring another Iconv in (e.g. on FreeBSD)
which has different symbols.
So check for Iconv after adding the ICU options
The old MinGW32 doesn't properly support C++11
Reproducer for crash due to type confusin as reported in
#210 (comment)
The value is always non-NULL so return a reference instead.
The default level is "identical" not "primary".
Also fix some typos in the documentation.
As documented this should throw on construction not on use.
- Remove single-use local variables
- Use nullptr instead of 0
- Assert return value
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.
ICU is linked against libc++ causing a crash when using GCC which by
default uses libstc++ causing symbol conflicts in the standard library.
In the en_US.ISO8859-1 'ç' and 'Ç' should be case-converted into each
other but on FreeBSD this doesn't seem to happen.
This isn't a bug in our library so just detect this.
False positives on drone.
Segfaults in most tests, likely related to ICU.
Not worth the effort
They hang indefinitely, potentially due to #206
Fix possible type confusion with `boost::locale::collator`
Remove magic numbers
Add const
In the en_US.ISO8859-1 'ç' and 'Ç' should be case-converted into each
other but on FreeBSD this doesn't seem to happen.
This isn't a bug in our library so just detect this.
E2BIG shall be returned if the output buffer is too small.
We pass a 64 byte buffer which should be enough to do *something*

However it is observed on MacOS Sonoma that iconv returns E2BIG without
doing any progress leading to an infinite loop as the same inputs will
be passed over and over.
See #206.
Instead raise an exception when this case is detected.
Iconv still fails to behave correctly:

- Testing correct invalid bytes skipping
-- UTF-8
--- At start single
----- [IConv]
--- At start multiple
----- [IConv]
--- At middle single
Error in line 167: to_utf<Char>(source, encoding) == target
---- [g] != [grU+00FCU+00DFen]
Error in line 77: conv(source) == target
---- [g] != [grU+00FCU+00DFen]
----- [IConv]
Error in line 85: convPtr->convert(source) == target
---- [g] != [grU+00FCU+00DFen]

and:

-- Error for decoding to UTF-8
Error in line 188: from_utf<Char>(source, encoding) == target
---- [gr�����üßen] != [grüßen]
Copy link

codecov bot commented Feb 13, 2024

Codecov Report

Attention: 4 lines in your changes are missing coverage. Please review.

Comparison is base (8445dce) 95.63% compared to head (299381b) 95.72%.
Report is 24 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #220      +/-   ##
==========================================
+ Coverage   95.63%   95.72%   +0.09%     
==========================================
  Files         114      116       +2     
  Lines       10138     9937     -201     
==========================================
- Hits         9695     9512     -183     
+ Misses        443      425      -18     
Files Coverage Δ
include/boost/locale/collator.hpp 100.00% <100.00%> (ø)
include/boost/locale/detail/any_string.hpp 100.00% <100.00%> (ø)
include/boost/locale/formatting.hpp 100.00% <100.00%> (ø)
src/boost/locale/encoding/iconv_converter.hpp 94.64% <100.00%> (+0.30%) ⬆️
src/boost/locale/shared/formatting.cpp 93.93% <ø> (+3.17%) ⬆️
src/boost/locale/shared/iconv_codecvt.cpp 89.47% <100.00%> (-0.40%) ⬇️
src/boost/locale/shared/ids.cpp 100.00% <100.00%> (ø)
src/boost/locale/shared/mo_lambda.cpp 100.00% <100.00%> (ø)
src/boost/locale/shared/std_collate_adapter.hpp 100.00% <100.00%> (ø)
src/boost/locale/win32/api.hpp 91.05% <100.00%> (+2.77%) ⬆️
... and 7 more

... and 49 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8445dce...299381b. Read the comment docs.

@Flamefire Flamefire merged commit 4fa93a9 into master Feb 13, 2024
94 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant