Skip to content

fix: decode the feed as utf-8 when no charset is declared - #37

Open
paodb wants to merge 1 commit into
masterfrom
fix/issue-35-feed-charset
Open

paodb wants to merge 1 commit into
masterfrom
fix/issue-35-feed-charset

Conversation

@paodb

@paodb paodb commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

When the response does not declare a charset, EntityUtils.toString decoded the feed as ISO-8859-1, which garbled non-ASCII characters (e.g. "Add‑ons" was displayed as "Addâ□□ons"). Decode it as UTF-8 instead, the default encoding for XML. A charset declared in the response is still honored.

Close #35

Summary by CodeRabbit

  • Bug Fixes
    • RSS feed content is now decoded consistently as UTF-8, improving the display of accented and other non-ASCII characters.

@coderabbitai

coderabbitai Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

obtainRss now decodes the response entity as UTF-8 instead of relying on the default encoding.

Changes

RSS response decoding

Layer / File(s) Summary
Decode RSS response as UTF-8
src/main/java/com/flowingcode/vaadin/addons/rssitems/RssItems.java
obtainRss decodes the response entity with UTF-8. The file imports StandardCharsets.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Change: Bug fix · Severity of issue fixed: Low

Merge Risk: Minimal · up to 6f6f4

Feeds that declare no charset will now decode as UTF-8, which fixes garbled non-ASCII text. Feeds that declare a charset are still decoded with it. The change is small, and no merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the main change: the feed is now decoded as UTF-8 when the response declares no charset. The raw summary confirms RssItems.obtainRss now decodes the entity as UTF-8 explicitly, and the…
Linked Issues check Passed Issue #35 requires that a feed without a charset parameter be decoded as UTF-8, and that a declared charset be honored. At the reviewed head, RssItems.obtainRss (src/main/java/com/flowingcode/vaadin/a…
Out of Scope Changes check Passed The whole-PR change set touches only RssItems.java. The changes are the UTF-8 default in the EntityUtils.toString call and the StandardCharsets import. Both directly implement issue #35. No unrelated …
Full details: Title check

Explanation

The title names the main change: the feed is now decoded as UTF-8 when the response declares no charset. The raw summary confirms RssItems.obtainRss now decodes the entity as UTF-8 explicitly, and the objectives describe the same fallback behavior, with declared charsets still honored. The title uses the conventional fix: prefix and is specific enough for a teammate scanning history.

Full details: Linked Issues check

Explanation

Issue #35 requires that a feed without a charset parameter be decoded as UTF-8, and that a declared charset be honored. At the reviewed head, RssItems.obtainRss (src/main/java/com/flowingcode/vaadin/addons/rssitems/RssItems.java) calls EntityUtils.toString(entity, StandardCharsets.UTF_8). This is the exact form the issue proposes. The StandardCharsets import is present. In HttpCore, the two-argument EntityUtils.toString uses the charset from the Content-Type header when one is declared. It uses the supplied default only when no charset is declared. The PR description states the same behavior. The change meets both parts of the objective. No automated test was added for the decoding behavior. The issue does not request a test, so this does not fail the objective. The base revision of the file could not be read through the diff tool. The base state is inferred from the summary (+2/-1 lines) and the reviewed head file.

Full details: Out of Scope Changes check

Explanation

The whole-PR change set touches only RssItems.java. The changes are the UTF-8 default in the EntityUtils.toString call and the StandardCharsets import. Both directly implement issue #35. No unrelated changes were found in the reviewed summary or the reviewed head file.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 39cae47e-8820-4872-8482-364a87085237
Commits

Reviewing files that changed from the base of the PR and between 0e8a7e5 and 6f6f4a9.

Files selected for processing: 1

  • src/main/java/com/flowingcode/vaadin/addons/rssitems/RssItems.java

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@sonarqubecloud

Copy link
Copy Markdown

@paodb
paodb marked this pull request as ready for review November 16, 2026 21:07
@paodb
paodb requested a review from scardanzan November 16, 2026 21:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: To Do

Development

Successfully merging this pull request may close these issues.

Non-ASCII characters are garbled when the feed does not declare a charset

1 participant