1) It's probably a good idea to add a comment around line 456 that Encoding is deprecated (see other comments in the area. Check the spec to see in which version it was deprecated.
2) You don't need to note the deprecation in the check. Try to more closely mirror the other deprecations
3) As a result of 2), Consider just wrapping lines 729 to 742 in a comment. When you send it upstream, they may consider removing it.
Thanks for the patch. A few notes:
1) It's probably a good idea to add a comment around line 456 that Encoding is deprecated (see other comments in the area. Check the spec to see in which version it was deprecated.
2) You don't need to note the deprecation in the check. Try to more closely mirror the other deprecations
3) As a result of 2), Consider just wrapping lines 729 to 742 in a comment. When you send it upstream, they may consider removing it.