openzim / zim-tools

Various ZIM command line tools
https://download.openzim.org/release/zim-tools/
GNU General Public License v3.0
133 stars 35 forks source link

Remove usage of deprecated `std::codecvt_utf8_utf16`. #376

Closed mgautierfr closed 1 year ago

mgautierfr commented 1 year ago

std::codecvt_utf8_utf16 is deprecated in c++17. We replace it with the usage of windows' MultiByteToWideChar function.

The new converter method is taken from libzim's FS::toWideChar in src/fs_windows.cpp with the only difference to return std::wstring instead of std::unique_ptr<wchar_t[]>. (https://github.com/openzim/libzim/blob/main/src/fs_windows.cpp#L131-L144)

(Triggered by https://github.com/kiwix/kiwix-build/actions/runs/6575114946/job/17861540481?pr=638)

codecov[bot] commented 1 year ago

Codecov Report

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

Comparison is base (e08484d) 27.58% compared to head (c073fb9) 27.49%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #376 +/- ## ========================================== - Coverage 27.58% 27.49% -0.10% ========================================== Files 26 26 Lines 2541 2550 +9 Branches 1350 1356 +6 ========================================== Hits 701 701 - Misses 1359 1369 +10 + Partials 481 480 -1 ``` | [Files](https://app.codecov.io/gh/openzim/zim-tools/pull/376?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=openzim) | Coverage Δ | | |---|---|---| | [src/zimdump.cpp](https://app.codecov.io/gh/openzim/zim-tools/pull/376?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=openzim#diff-c3JjL3ppbWR1bXAuY3Bw) | `0.00% <0.00%> (ø)` | | ... and [1 file with indirect coverage changes](https://app.codecov.io/gh/openzim/zim-tools/pull/376/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=openzim)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.