fix: remove iso-encoding for umlaut issue#506
Conversation
There was a problem hiding this comment.
Pull Request Overview
This pull request fixes Unicode handling in string escaping by removing the conversion to Latin-1 (ISO-8859-1) encoding and allowing proper UTF-8 percent-encoding for non-ASCII characters. This resolves issues with umlaut characters and other Unicode characters being incorrectly encoded.
- Removed Latin-1 encoding conversion from
TibiaDataQueryEscapeStringfunction - Updated test expectations to match UTF-8 percent-encoding output
- Added new test case for "Näurin" to verify proper umlaut handling
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/TibiaDataUtils.go | Removed Latin-1 encoding conversion, allowing direct UTF-8 percent-encoding |
| src/TibiaDataUtils_test.go | Updated test expectations and added new test case for Unicode handling |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #506 +/- ##
==========================================
- Coverage 80.30% 80.23% -0.08%
==========================================
Files 22 22
Lines 3697 3694 -3
==========================================
- Hits 2969 2964 -5
- Misses 587 589 +2
Partials 141 141 🚀 New features to boost your workflow:
|
Co-Authored-By: Skyliife <82951416+skyliife@users.noreply.github.com>
724f4a5 to
9fe3456
Compare
|



This pull request updates the string escaping logic in
TibiaDataQueryEscapeStringand its associated tests to improve Unicode handling and simplify encoding. The main change is the removal of the conversion to Latin-1 encoding, allowing proper UTF-8 percent-encoding for non-ASCII characters.String escaping and encoding improvements:
TibiaDataQueryEscapeString, so strings are now percent-encoded directly in UTF-8, which is the standard for URLs.TestEscaperto expect UTF-8 percent-encoded output for non-ASCII characters, and added a new test case for the stringNäurin.fix #470
close #471