webfeed icon indicating copy to clipboard operation
webfeed copied to clipboard

Problems with UTF-8 encoding

Open noahendtner opened this issue 3 years ago • 4 comments

I built an RSSReader to get some news from a german news television shows RSS feed, and since its german it has some special characters in it (äüöÄÜÖ) and those get picked up wrong by the UTF-8 encoding:

All of the german special characters get somehow replaced by Ä and some garbage cause the translator adds 2 UTS-8 bytes (dez. 131 & 164) behind the 165 byte which indicates the german and some other special characters.

noahendtner avatar Mar 04 '21 19:03 noahendtner

Do you have an example feed? I can't reproduce this, testing with a few German RSS feeds, which all use UTF-8.

frankosterfeld avatar Apr 20 '21 14:04 frankosterfeld

Update: I can reproduce this with https://www.tagesschau.de/xml/rss2 (which matches the description above :)). Feed looks correctly UTF-8 encoded, and other than this RSS 2 feed, the RDF feed works fine.

frankosterfeld avatar Apr 21 '21 09:04 frankosterfeld

nyt

sgehrman avatar Sep 09 '21 20:09 sgehrman

you can solve this by adding

import 'dart:convert' show utf8;
...
your_correct_string = utf8.decode(your_string.runes.toList());

Persie0 avatar Feb 06 '22 12:02 Persie0