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

Use ICU's C API only #47

Merged
merged 3 commits into from
Jul 5, 2024
Merged

Use ICU's C API only #47

merged 3 commits into from
Jul 5, 2024

Conversation

rmisev
Copy link
Member

@rmisev rmisev commented Jul 4, 2024

What is done:

  • Replace the C++ ICU function icu::toUCharPtr with the locally implemented to_UChar_ptr function.
  • Use u_getVersion function to get ICU major version

Benefits:

  • Using ICU's C API only allows the program to run with a different version of ICU than the compiled one.
  • ICU 75.1 C++ API requires C++17. When using the C API only, a C++11 or C++14 compiler can be used.

See also: https://unicode-org.github.io/icu/userguide/icu4c/build.html#icu-as-a-system-level-library

Copy link

codecov bot commented Jul 4, 2024

Codecov Report

Attention: Patch coverage is 83.33333% with 2 lines in your changes missing coverage. Please review.

Project coverage is 99.65%. Comparing base (0877b18) to head (b873487).

Files Patch % Lines
src/url_idna.cpp 83.33% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #47      +/-   ##
==========================================
- Coverage   99.74%   99.65%   -0.09%     
==========================================
  Files          16       16              
  Lines        2322     2333      +11     
  Branches      386      387       +1     
==========================================
+ Hits         2316     2325       +9     
- Misses          6        8       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Replace the C++ ICU function icu::toUCharPtr with the locally
implemented to_UChar_ptr function.
This gets the correct version when the program is run with a different
version of ICU than the compiled one.
@rmisev rmisev merged commit b873487 into main Jul 5, 2024
22 of 23 checks passed
@rmisev rmisev deleted the icu-c-api branch July 5, 2024 15:24
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.

1 participant