Skip to content

Conversation

@tobiasehlert
Copy link
Member

This pull request updates the string escaping logic in TibiaDataQueryEscapeString and 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:

  • Removed the conversion to Latin-1 encoding in TibiaDataQueryEscapeString, so strings are now percent-encoded directly in UTF-8, which is the standard for URLs.
  • Updated the tests in TestEscaper to expect UTF-8 percent-encoded output for non-ASCII characters, and added a new test case for the string Näurin.

fix #470
close #471

@tobiasehlert tobiasehlert self-assigned this Sep 17, 2025
@tobiasehlert tobiasehlert added the go Pull requests that update Go code label Sep 17, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 TibiaDataQueryEscapeString function
  • 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
Copy link

codecov bot commented Sep 17, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.23%. Comparing base (b762ecc) to head (9fe3456).
⚠️ Report is 2 commits behind head on main.

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:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Co-Authored-By: Skyliife <82951416+skyliife@users.noreply.github.com>
@tobiasehlert tobiasehlert force-pushed the fix-remove-iso-encoding-for-umlaut-issue branch from 724f4a5 to 9fe3456 Compare September 17, 2025 12:40
@sonarqubecloud
Copy link

@tobiasehlert tobiasehlert merged commit 8e1ad9c into main Sep 17, 2025
7 checks passed
@tobiasehlert tobiasehlert deleted the fix-remove-iso-encoding-for-umlaut-issue branch September 17, 2025 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

go Pull requests that update Go code

Development

Successfully merging this pull request may close these issues.

bug: character issues with umlauts

2 participants