Skip to content

Add Latin1 Encoding Check in from Method#4945

Open
rajat552 wants to merge 3 commits intoboa-dev:mainfrom
rajat552:check-latin1-encoding
Open

Add Latin1 Encoding Check in from Method#4945
rajat552 wants to merge 3 commits intoboa-dev:mainfrom
rajat552:check-latin1-encoding

Conversation

@rajat552
Copy link
Contributor

@rajat552 rajat552 commented Mar 8, 2026

Summary

This pull request introduces a check for Latin1 encoding in the from method of the JsString implementation. Previously, the method only handled ASCII strings, but this update extends support to strings containing characters within the Latin1 range (0x00 to 0xFF).

Changes

  • Added a condition to check whether all characters in the input string fall within the Latin1 range.
  • Updated the from method to handle Latin1-compatible strings by converting them to JsStr::latin1.

Testing

  • Ran the full test suite to verify the changes.
  • All existing tests passed successfully, confirming that no regressions were introduced.

Impact

This change improves string handling by allowing the from method to support Latin1-encoded strings. As a result, the implementation becomes more robust and capable of handling a wider range of character inputs efficiently.

Closes #4944

@rajat552 rajat552 requested a review from a team as a code owner March 8, 2026 06:03
@github-actions
Copy link

github-actions bot commented Mar 8, 2026

Test262 conformance changes

Test result main count PR count difference
Total 52,963 52,963 0
Passed 49,687 49,687 0
Ignored 2,262 2,262 0
Failed 1,014 1,014 0
Panics 0 0 0
Conformance 93.81% 93.81% 0.00%

Tested main commit: 34ca7f1f404c2712d6897c3e39e5f5e981ce9ed6
Tested PR commit: 38660e8322f49c0d3974f7a718f93d8884c557e6
Compare commits: 34ca7f1...38660e8

@codecov
Copy link

codecov bot commented Mar 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 57.95%. Comparing base (6ddc2b4) to head (38660e8).
⚠️ Report is 779 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##             main    #4945       +/-   ##
===========================================
+ Coverage   47.24%   57.95%   +10.71%     
===========================================
  Files         476      557       +81     
  Lines       46892    60962    +14070     
===========================================
+ Hits        22154    35331    +13177     
- Misses      24738    25631      +893     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@rajat552
Copy link
Contributor Author

@jedel1043 review this PR let me know if any changes required

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enhancement: Add Latin1 Encoding Check in from Method

1 participant