Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 5, 2025

Polish letters (Ł, Ń, ą, etc.) and other UTF-8 characters were rendering incorrectly in the debug page when viewing HTTP response bodies.

Changes

  • LoggingHttpClient: Replace http.Response.bytes().body with explicit utf8.decode(responseBodyBytes, allowMalformed: true) to ensure consistent UTF-8 decoding regardless of Content-Type header charset
  • Test coverage: Add test case verifying Polish character decoding from byte streams

Technical Detail

Previous implementation relied on the http package's charset detection from Content-Type headers, which could fail or use incorrect encoding. Direct UTF-8 decoding ensures special characters display correctly.

// Before
responseBodyCompleter.complete(
  http.Response.bytes(responseBodyBytes, response.statusCode).body,
);

// After
final responseBody = utf8.decode(responseBodyBytes, allowMalformed: true);
responseBodyCompleter.complete(responseBody);
Original prompt

This section details on the original issue you should resolve

<issue_title>[debug_page] Polish letters are not displayed</issue_title>
<issue_description>Image Letters like Ł,Ń,ą etc are not displayed properly</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 5 commits November 5, 2025 11:05
Co-authored-by: PiotrRogulski <18120733+PiotrRogulski@users.noreply.github.com>
Co-authored-by: PiotrRogulski <18120733+PiotrRogulski@users.noreply.github.com>
Co-authored-by: PiotrRogulski <18120733+PiotrRogulski@users.noreply.github.com>
Co-authored-by: PiotrRogulski <18120733+PiotrRogulski@users.noreply.github.com>
Co-authored-by: PiotrRogulski <18120733+PiotrRogulski@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix display issue for Polish letters on debug page Fix UTF-8 character display in debug page response bodies Nov 5, 2025
Copilot AI requested a review from PiotrRogulski November 5, 2025 11:20
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.

[debug_page] Polish letters are not displayed

2 participants