Closed Bug 1466807 Opened 6 years ago Closed 6 years ago

Update encoding_rs to 0.8.0

Categories

(Core :: Internationalization, defect, P3)

defect

Tracking

()

RESOLVED FIXED
mozilla62
Tracking Status
firefox62 --- fixed

People

(Reporter: hsivonen, Assigned: hsivonen)

References

Details

Attachments

(1 file)

The main reason to update is NEON capability that allows us to fix bug 1397807. (This bug isn't about enabling the NEON capability. Let's leave it to the other bug.)

Additionally, this version brings a huge performance boost to UTF-16LE and UTF-16BE decode, though that has little significance in practice.

As usual, rustfmt updates have messed up the reviewability of the diff. The repo history at https://github.com/hsivonen/encoding_rs may be more readable.
The cargo feature changes here are not meant to change anything in Firefox. The crate's default behavior changed to match Firefox, so the need for Firefox to pass a feature flag went away.
Attachment #8983364 - Flags: review?(VYV03354)
Comment on attachment 8983364 [details]
Bug 1466807 - Update encoding_rs to 0.8.0.

https://reviewboard.mozilla.org/r/249272/#review256438

::: third_party/rust/encoding_c/include/encoding_rs_cpp.h:953
(Diff revision 1)
>        decoder->max_utf8_buffer_length_without_replacement(bytes.size());
> -    if (needed == SIZE_MAX) {
> +    if (!needed) {
>        throw std::overflow_error("Overflow in buffer size computation.");
>      }
> -    std::string string(needed, '\0');
> -    uint32_t result;
> +    std::string string(needed.value(), '\0');
> +    const auto [result, read, written] =

Are structured bindings already available everywhere?
Priority: -- → P3
(In reply to Masatoshi Kimura [:emk] from comment #3)
> Are structured bindings already available everywhere?

No, but that file is part of the materials the crate provides for non-Gecko users. The file is not used by Gecko. It just gets vendored under third_party with the whole package.
Comment on attachment 8983364 [details]
Bug 1466807 - Update encoding_rs to 0.8.0.

https://reviewboard.mozilla.org/r/249272/#review256534

rs=me as long as this is a verbatim copy from upstream.
Attachment #8983364 - Flags: review?(VYV03354) → review+
(In reply to Masatoshi Kimura [:emk] from comment #5)
> Comment on attachment 8983364 [details]
> Bug 1466807 - Update encoding_rs to 0.8.0.
> 
> https://reviewboard.mozilla.org/r/249272/#review256534
> 
> rs=me as long as this is a verbatim copy from upstream.

It is. Thank you.
https://hg.mozilla.org/mozilla-central/rev/466d43707902
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla62
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: