-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
[rb] Add force encoding to remove warnings caused by json 3.0 #16728
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
Conversation
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
|||||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||
…nium into rb_fix_json_encoding_warning
User description
🔗 Related Issues
Fixes #16703
💥 What does this PR do?
This PR adds a helper method to enforce encoding in http/common
🔧 Implementation Notes
I implement it this way in order to try to catch all the values before they are passed to JSON
🔄 Types of changes
PR Type
Bug fix
Description
Adds UTF-8 encoding enforcement to prevent JSON 3.0 compatibility warnings
Recursively converts binary-encoded strings in command hashes before JSON serialization
Handles nested structures (hashes and arrays) with proper encoding validation
Raises descriptive errors for invalid byte sequences that cannot be encoded
Diagram Walkthrough
File Walkthrough
common.rb
Add UTF-8 encoding conversion for JSON compatibilityrb/lib/selenium/webdriver/remote/http/common.rb
BINARY_ENCODINGSconstant to identify binary-encoded stringsensure_utf8_encodingmethod to recursively process commandhashes
encode_string_to_utf8helper to convert strings withproper validation
callmethod
common_spec.rb
Add encoding conversion test coveragerb/spec/unit/selenium/webdriver/remote/http/common_spec.rb