security: replace unmaintained encoding crate with encoding_rs #704
+204
−163
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR resolves the security vulnerability RUSTSEC-2021-0153 by replacing the unmaintained
encodingcrate with the actively maintainedencoding_rscrate.Changes Made
encoding/Cargo.tomlto useencoding_rs = "0.8.35"instead ofencoding = "0.2.33".encoding/src/text.rsusingencoding_rswhile maintaining full backward compatibility with the existingTextCodectrait interface.Character Set Mapping:
encoding→encoding_rsencoding)encoding_rs)encoding::all::ASCIIWINDOWS_1252encoding::all::WINDOWS_31JSHIFT_JISencoding::all::ISO_2022_JPISO_2022_JPencoding::all::ISO_8859_1WINDOWS_1252encoding::all::ISO_8859_2ISO_8859_2encoding::all::ISO_8859_3ISO_8859_3encoding::all::ISO_8859_4ISO_8859_4encoding::all::ISO_8859_7ISO_8859_7encoding::all::ISO_8859_6ISO_8859_6encoding::all::ISO_8859_8ISO_8859_8encoding::all::ISO_8859_5ISO_8859_5encoding::all::WINDOWS_949EUC_KRencoding::all::WINDOWS_874WINDOWS_874encoding::all::UTF_8UTF_8encoding::all::GB18030GB18030encoding::all::GBKGBKKey Compatibility Notes:
encoding_rsdid not have a 1:1 encoding available.encoding_rsmappings are supersets or exact equivalents of the original character sets.Testing
cargo deny check advisories- no security vulnerabilities remain.Closes #577 .