XML Response Received is Gibberish

136

Looks like the server does not set the response charset in the format the HTTP library expects it. response.body wrongly decodes the response data as Latin1.

If you can't fix the server, the following code manually decodes the raw data as UTF-8 and works for me:

final response = await http.get("http://rcs.mako.co.il/rss/food-recipes.xml");
final body = Utf8Decoder().convert(response.bodyBytes);
final document = xml.parse(body);
print(document.toString());
Share:
136
Tal Barda
Author by

Tal Barda

QuackOverflow🦆 I made the Wiki Race Android App

Updated on December 18, 2022

Comments

  • Tal Barda
    Tal Barda 12 months

    I'm trying to parse this RSS feed's XML response (its content is in Hebrew): http://rcs.mako.co.il/rss/food-recipes.xml

    In order to do that I make an HTTP request:

    final response = await http.get(
              "http://rcs.mako.co.il/rss/food-recipes.xml",
              headers: {"Content-type": "text/xml; charset=utf-8"}
            );
    

    My problem is that instead of getting the response with its original content, I get it with gibberish (within the body attribute):

    <?xml version="1.0" encoding="UTF-8" ?>
    <rss version="2.0">
      <channel>
        <title>×××× - ×ת××× ×× ××ר×××ת</title>
        <link>https://www.mako.co.il/food-recipes</link>
        <description>×××× - ×ת××× ×× ××ר×××ת</description>
        <language>he</language>
        <item>
          <title>××× ×××× ×× ×¤××¦× ×××ר×, ××× ×©×ר×× ×××× ××××</title>
          <description>×××צק? ×¨× ×× ×¢×× ×©××× ××ר×× ××××&lt;p&gt;&lt;img src=&apos;https://img.mako.co.il/2020/03/17/pizzaKAIMG_0864_a.jpg&apos;/&gt;&lt;/p&gt;</description>
          <link>https://www.mako.co.il/food-recipes/recipes_column-bread/Recipe-efa076581b9e071027.htm?Partner=rss</link>
          <pubDate>Thu, 19 Mar 2020 07:19:00 +0200</pubDate>
          <guid>efa076581b9e0710VgnVCM100000700a10acRCRD</guid>
          <shortDescription>×××צק? ×¨× ×× ×¢×× ×©××× ××ר×× ××××</shortDescription>
          <image>https://img.mako.co.il/2020/03/17/pizzaKAIMG_0864_a.jpg</image>
          <image139X80>https://img.mako.co.il/2020/03/17/pizzaKAIMG_0864_f.jpg</image139X80>
          <image435X329>https://img.mako.co.il/2020/03/17/pizzaKAIMG_0864_c.jpg</image435X329>
          <image624X383>https://img.mako.co.il/2020/03/17/pizzaKAIMG_0864_i.jpg</image624X383>
          <photographer>×§×¨× ×××</photographer>
        </item>
        <item>
          <title>×ש ××ר ×××, ×××× ××¢×× ×××××: ××××ª× ××× ××צ××</title>
          <description>××ת××× ××ס××¡× ××× ××× ×©×ª×צ×× ×××××ª× ×××¢×× ×ת&lt;p&gt;&lt;img src=&apos;https://img.mako.co.il/2020/01/06/VEGAN_CHAVITA_ORI_SHAVIT_a.jpg&apos;/&gt;&lt;/p&gt;</description>
          <link>https://www.mako.co.il/food-recipes/recipes_column-30-minutes/Recipe-5cb7486ed9a7f61027.htm?Partner=rss</link>
          <pubDate>Thu, 19 Mar 2020 06:02:00 +0200</pubDate>
          <guid>5cb7486ed9a7f610VgnVCM100000700a10acRCRD</guid>
          <shortDescription>××ת××× ××ס××¡× ××× ××× ×©×ª×צ×× ×××××ª× ×××¢×× ×ת</shortDescription>
          <image>https://img.mako.co.il/2020/01/06/VEGAN_CHAVITA_ORI_SHAVIT_a.jpg</image>
          <image139X80>https://img.mako.co.il/2020/01/06/VEGAN_CHAVITA_ORI_SHAVIT_f.jpg</image139X80>
          <image435X329>https://img.mako.co.il/2020/01/06/VEGAN_CHAVITA_ORI_SHAVIT_c.jpg</image435X329>
          <image624X383>https://img.mako.co.il/2020/01/06/VEGAN_CHAVITA_ORI_SHAVIT_i.jpg</image624X383>
          <photographer>×××¨× ×©×××</photographer>
        </item>
        <item>
          <title>×ת×× × ×× ×××××? ××× × ××× ××××¨× ×נר××× ××ש××××</title>
          <description>רק ש××× ××¦× ×¢×× ×××ר××, ש×××× ××× ×× ×××ר×&lt;p&gt;&lt;img src=&apos;https://img.mako.co.il/2020/03/04/quaker_energyballIMG_0734_a.jpg&apos;/&gt;&lt;/p&gt;</description>
          <link>https://www.mako.co.il/food-recipes/recipes_column-healthy/Recipe-0fd289d29a5a071026.htm?Partner=rss</link>
          <pubDate>Wed, 18 Mar 2020 07:24:00 +0200</pubDate>
          <guid>0fd289d29a5a0710VgnVCM200000650a10acRCRD</guid>
          <shortDescription>רק ש××× ××¦× ×¢×× ×××ר××, ש×××× ××× ×× ×××ר×</shortDescription>
          <image>https://img.mako.co.il/2020/03/04/quaker_energyballIMG_0734_a.jpg</image>
          <image139X80>https://img.mako.co.il/2020/03/04/quaker_energyballIMG_0734_f.jpg</image139X80>
          <image435X329>https://img.mako.co.il/2020/03/04/quaker_energyballIMG_0734_c.jpg</image435X329>
          <image624X383>https://img.mako.co.il/2020/03/04/quaker_energyballIMG_0734_i.jpg</image624X383>
          <photographer>ר×× ×××× × ××</photographer>
        </item>
        <item>
          <title>ק××× ×ת ×××¡× ×××××ª× ×××פ×× × ×©××ר××£ ×ת ×רשת</title>
          <description>×× × ××ש×תת ×××פ×ת שס×× ×©× ×××× × ×ת עצ××&lt;p&gt;&lt;img src=&apos;https://img.mako.co.il/2020/03/16/TOST_HAVITA2_a.jpg&apos;/&gt;&lt;/p&gt;</description>
          <link>https://www.mako.co.il/food-recipes/recipes_column-bread/Recipe-a903cb9de52e071026.htm?Partner=rss</link>
          <pubDate>Tue, 17 Mar 2020 07:00:00 +0200</pubDate>
          <guid>a903cb9de52e0710VgnVCM200000650a10acRCRD</guid>
          <shortDescription>×× × ××ש×תת ×××פ×ת שס×× ×©× ×××× × ×ת עצ××</shortDescription>
          <image>https://img.mako.co.il/2020/03/16/TOST_HAVITA2_a.jpg</image>
          <image139X80>https://img.mako.co.il/2020/03/16/TOST_HAVITA2_f.jpg</image139X80>
          <image435X329>https://img.mako.co.il/2020/03/16/TOST_HAVITA2_c.jpg</image435X329>
          <image624X383>https://img.mako.co.il/2020/03/16/TOST_HAVITA2_i.jpg</image624X383>
          <photographer>ר×× ×××× × ××</photographer>
        </item>
        <item>
          <title>×ר××ת ×צ×ר××× ×©× ××××: קצ×צ×ת ק×פ××××</title>
          <description>ש××× ×× ××× ×קצ×צ×ת ×××× ××××ת?&lt;p&gt;&lt;img src=&apos;https://img.mako.co.il/2020/03/15/89840581_626359704763655_6478026342796361728_n_a.jpg&apos;/&gt;&lt;/p&gt;</description>
          <link>https://www.mako.co.il/food-recipes/recipes_column-meat/Recipe-cc40f835e3fd071026.htm?Partner=rss</link>
          <pubDate>Mon, 16 Mar 2020 07:12:00 +0200</pubDate>
          <guid>cc40f835e3fd0710VgnVCM200000650a10acRCRD</guid>
          <shortDescription>ש××× ×× ××× ×קצ×צ×ת ×××× ××××ת?</shortDescription>
          <image>https://img.mako.co.il/2020/03/15/89840581_626359704763655_6478026342796361728_n_a.jpg</image>
          <image139X80>https://img.mako.co.il/2020/03/15/89840581_626359704763655_6478026342796361728_n_f.jpg</image139X80>
          <image435X329>https://img.mako.co.il/2020/03/15/89840581_626359704763655_6478026342796361728_n_c.jpg</image435X329>
          <image624X383>https://img.mako.co.il/2020/03/15/89840581_626359704763655_6478026342796361728_n_i.jpg</image624X383>
          <photographer>×פרת ×&apos;ר×פ×</photographer>
        </item>
        <item>
          <title>תק××¢×× ×××ת? ת××× × ×¢××××ת ×רנ××× ×¢× ×§××ת!</title>
          <description>×נצ××× ×ת ×××× ×¢× ×××××× ×××ת ××× ××× ×××¢××&lt;p&gt;&lt;img src=&apos;https://img.mako.co.il/2020/03/04/quaker_cookies_ronyoIMG_0772_a.jpg&apos;/&gt;&lt;/p&gt;</description>
          <link>https://www.mako.co.il/food-recipes/recipes_column-cakes/Recipe-301bfee6265a071026.htm?Partner=rss</link>
          <pubDate>Mon, 16 Mar 2020 07:09:00 +0200</pubDate>
          <guid>301bfee6265a0710VgnVCM200000650a10acRCRD</guid>
          <shortDescription>×נצ××× ×ת ×××× ×¢× ×××××× ×××ת ××× ××× ×××¢××</shortDescription>
          <image>https://img.mako.co.il/2020/03/04/quaker_cookies_ronyoIMG_0772_a.jpg</image>
          <image139X80>https://img.mako.co.il/2020/03/04/quaker_cookies_ronyoIMG_0772_f.jpg</image139X80>
          <image435X329>https://img.mako.co.il/2020/03/04/quaker_cookies_ronyoIMG_0772_c.jpg</image435X329>
          <image624X383>https://img.mako.co.il/2020/03/04/quaker_cookies_ronyoIMG_0772_i.jpg</image624X383>
          <photographer>ר×× ×××× × ××</photographer>
        </item>
        <item>
          <title>××× ×¢×××× ××× ×× × ×¤×¨××¡× ×××ת ×××× ×, ×× ×ר×ר</title>
          <description>×¢××ת ש×ש ש××× ×× ×¢××ת תפ×××× ××××××&lt;p&gt;&lt;img src=&apos;https://img.mako.co.il/2020/03/11/shashapplesIMG_0518_a.jpg&apos;/&gt;&lt;/p&gt;</description>
          <link>https://www.mako.co.il/food-recipes/recipes_column-cakes/Recipe-8a8826fd529c071027.htm?Partner=rss</link>
          <pubDate>Thu, 12 Mar 2020 07:14:00 +0200</pubDate>
          <guid>8a8826fd529c0710VgnVCM100000700a10acRCRD</guid>
          <shortDescription>×¢××ת ש×ש ש××× ×× ×¢××ת תפ×××× ××××××</shortDescription>
          <image>https://img.mako.co.il/2020/03/11/shashapplesIMG_0518_a.jpg</image>
          <image139X80>https://img.mako.co.il/2020/03/11/shashapplesIMG_0518_f.jpg</image139X80>
          <image435X329>https://img.mako.co.il/2020/03/11/shashapplesIMG_0518_c.jpg</image435X329>
          <image624X383>https://img.mako.co.il/2020/03/11/shashapplesIMG_0518_i.jpg</image624X383>
          <photographer>×§×¨× ×××</photographer>
        </item>
        <item>
          <title>××× ×× ××× ×¤×××××ת ××× ××××¨× ×××ר ×××</title>
          <description>×××ת ×ספצ×פ×ת ×× ××¢××× ×ר××ת ××ר×ת&lt;p&gt;&lt;img src=&apos;https://img.mako.co.il/2020/03/08/17dayslazagne_a.jpg&apos;/&gt;&lt;/p&gt;</description>
          <link>https://www.mako.co.il/food-recipes/recipes_column-gluten-free/Recipe-a5d628ad7a9b071026.htm?Partner=rss</link>
          <pubDate>Tue, 10 Mar 2020 08:53:00 +0200</pubDate>
          <guid>a5d628ad7a9b0710VgnVCM200000650a10acRCRD</guid>
          <shortDescription>×××ת ×ספצ×פ×ת ×× ××¢××× ×ר××ת ××ר×ת</shortDescription>
          <image>https://img.mako.co.il/2020/03/08/17dayslazagne_a.jpg</image>
          <image139X80>https://img.mako.co.il/2020/03/08/17dayslazagne_f.jpg</image139X80>
          <image435X329>https://img.mako.co.il/2020/03/08/17dayslazagne_c.jpg</image435X329>
          <image624X383>https://img.mako.co.il/2020/03/08/17dayslazagne_i.jpg</image624X383>
          <photographer>××××ר ×¨× ×××</photographer>
        </item>
        <item>
          <title>תש××× ××× ×× ×©×××¢×ª× ×¢× ×¡×× ××××××רף ××××××××</title>
          <description>ק××× ×ת ××××××רף ×× ×× ×ª× × ××× ×נש×× ×× ×©× ××××&lt;p&gt;&lt;img src=&apos;https://img.mako.co.il/2020/03/05/waldorf_yogev26.2.200633_a.jpg&apos;/&gt;&lt;/p&gt;</description>
          <link>https://www.mako.co.il/food-recipes/recipes_column-salads/Recipe-4a91f077d8aa071026.htm?Partner=rss</link>
          <pubDate>Sun, 08 Mar 2020 07:03:00 +0200</pubDate>
          <guid>4a91f077d8aa0710VgnVCM200000650a10acRCRD</guid>
          <shortDescription>ק××× ×ת ××××××רף ×× ×× ×ª× × ××× ×נש×× ×× ×©× ××××</shortDescription>
          <image>https://img.mako.co.il/2020/03/05/waldorf_yogev26.2.200633_a.jpg</image>
          <image139X80>https://img.mako.co.il/2020/03/05/waldorf_yogev26.2.200633_f.jpg</image139X80>
          <image435X329>https://img.mako.co.il/2020/03/05/waldorf_yogev26.2.200633_c.jpg</image435X329>
          <image624X383>https://img.mako.co.il/2020/03/05/waldorf_yogev26.2.200633_i.jpg</image624X383>
          <photographer>×××ר ×× ××</photographer>
        </item>
        <item>
          <title>××¢××××ת ×ר××× ×××× ×ש ×ת××ת ס××</title>
          <description>×× ×ª××× ×××××, × ××× ×ת×× ×× ××××× ××××&lt;p&gt;&lt;img src=&apos;https://img.mako.co.il/2020/01/09/P1980863_a.jpg&apos;/&gt;&lt;/p&gt;</description>
          <link>https://www.mako.co.il/food-recipes/recipes_column-cakes/Recipe-5cfaa737a6a8f61027.htm?Partner=rss</link>
          <pubDate>Thu, 05 Mar 2020 07:19:00 +0200</pubDate>
          <guid>5cfaa737a6a8f610VgnVCM100000700a10acRCRD</guid>
          <shortDescription>×× ×ª××× ×××××, × ××× ×ת×× ×× ××××× ××××</shortDescription>
          <image>https://img.mako.co.il/2020/01/09/P1980863_a.jpg</image>
          <image139X80>https://img.mako.co.il/2020/01/09/P1980863_f.jpg</image139X80>
          <image435X329>https://img.mako.co.il/2020/01/09/P1980863_c.jpg</image435X329>
          <image624X383>https://img.mako.co.il/2020/01/09/P1980863_i.jpg</image624X383>
          <photographer>×××¨× ×©×××</photographer>
        </item>
        <item>
          <title>×××× ××ת ש×ק××× ×¦&apos;×פס ××ר×פ×ת ×ש×ת</title>
          <description>××תר ××× ××× ××ר××ת ××קר ש×ת - פש×× ×××&lt;p&gt;&lt;img src=&apos;https://img.mako.co.il/2020/03/04/ROHAV_lahmaniotCCIMG_0092_a.jpg&apos;/&gt;&lt;/p&gt;</description>
          <link>https://www.mako.co.il/food-recipes/recipes_column-cakes/Recipe-e6c997d5045a071026.htm?Partner=rss</link>
          <pubDate>Thu, 05 Mar 2020 07:12:00 +0200</pubDate>
          <guid>e6c997d5045a0710VgnVCM200000650a10acRCRD</guid>
          <shortDescription>××תר ××× ××× ××ר××ת ××קר ש×ת - פש×× ×××</shortDescription>
          <image>https://img.mako.co.il/2020/03/04/ROHAV_lahmaniotCCIMG_0092_a.jpg</image>
          <image139X80>https://img.mako.co.il/2020/03/04/ROHAV_lahmaniotCCIMG_0092_f.jpg</image139X80>
          <image435X329>https://img.mako.co.il/2020/03/04/ROHAV_lahmaniotCCIMG_0092_c.jpg</image435X329>
          <image624X383>https://img.mako.co.il/2020/03/04/ROHAV_lahmaniotCCIMG_0092_i.jpg</image624X383>
          <photographer>×§×¨× ×××</photographer>
        </item>
        <item>
          <title>×ש×× × ××ת×: ××ת××× ××××× × ×××× ×©× ×¨×××××</title>
          <description>×× ×× ××©× × ×× ××××××, ××צק ×××× ××××ת ××¢×××&lt;p&gt;&lt;img src=&apos;https://img.mako.co.il/2020/03/01/erezbenshahar_haman2020_recipe_a.jpg&apos;/&gt;&lt;/p&gt;</description>
          <link>https://www.mako.co.il/food-recipes/recipes_column-holidays/Recipe-36dbad97f169071027.htm?Partner=rss</link>
          <pubDate>Wed, 04 Mar 2020 07:18:00 +0200</pubDate>
          <guid>36dbad97f1690710VgnVCM100000700a10acRCRD</guid>
          <shortDescription>×× ×× ××©× × ×× ××××××, ××צק ×××× ××××ת ××¢×××</shortDescription>
          <image>https://img.mako.co.il/2020/03/01/erezbenshahar_haman2020_recipe_a.jpg</image>
          <image139X80>https://img.mako.co.il/2020/03/01/erezbenshahar_haman2020_recipe_f.jpg</image139X80>
          <image435X329>https://img.mako.co.il/2020/03/01/erezbenshahar_haman2020_recipe_c.jpg</image435X329>
          <image624X383>https://img.mako.co.il/2020/03/01/erezbenshahar_haman2020_recipe_i.jpg</image624X383>
          <photographer>××¨× ×× ×©×ר</photographer>
        </item>
        <item>
          <title>×צ×× × ××¨× ×¤× ×ס××ת ×ש××¨× ×ת ×××××¡× ×©× ×××קר</title>
          <description>×× ×××× ×©× ×××סת ק×××קר ×¢× ×× ××××£ ×©× ×¤××&lt;p&gt;&lt;img src=&apos;https://img.mako.co.il/2020/03/03/DAISA_APLLEPIE_a.jpg&apos;/&gt;&lt;/p&gt;</description>
          <link>https://www.mako.co.il/food-recipes/recipes_column-healthy/Recipe-7f5118535df9071026.htm?Partner=rss</link>
          <pubDate>Wed, 04 Mar 2020 07:00:00 +0200</pubDate>
          <guid>7f5118535df90710VgnVCM200000650a10acRCRD</guid>
          <shortDescription>×× ×××× ×©× ×××סת ק×××קר ×¢× ×× ××××£ ×©× ×¤××</shortDescription>
          <image>https://img.mako.co.il/2020/03/03/DAISA_APLLEPIE_a.jpg</image>
          <image139X80>https://img.mako.co.il/2020/03/03/DAISA_APLLEPIE_f.jpg</image139X80>
          <image435X329>https://img.mako.co.il/2020/03/03/DAISA_APLLEPIE_c.jpg</image435X329>
          <image624X383>https://img.mako.co.il/2020/03/03/DAISA_APLLEPIE_i.jpg</image624X383>
          <photographer>ר×× ×××× × ××</photographer>
        </item>
        <item>
          <title>×××פ ×ק×× ×©×©×× × ×× × ×ת ×שנ××¦× ××§×¦× ×קצ×</title>
          <description>××¤× × ×©××ª× ×ר×××× ××× ××ª× ×××××× ×נס×ת ×××ת!&lt;p&gt;&lt;img src=&apos;https://img.mako.co.il/2020/03/01/20200210_120445_a.jpg&apos;/&gt;&lt;/p&gt;</description>
          <link>https://www.mako.co.il/food-recipes/recipes_column-chicken/Recipe-66843b143d59071027.htm?Partner=rss</link>
          <pubDate>Tue, 03 Mar 2020 07:14:00 +0200</pubDate>
          <guid>66843b143d590710VgnVCM100000700a10acRCRD</guid>
          <shortDescription>××¤× × ×©××ª× ×ר×××× ××× ××ª× ×××××× ×נס×ת ×××ת!</shortDescription>
          <image>https://img.mako.co.il/2020/03/01/20200210_120445_a.jpg</image>
          <image139X80>https://img.mako.co.il/2020/03/01/20200210_120445_f.jpg</image139X80>
          <image435X329>https://img.mako.co.il/2020/03/01/20200210_120445_c.jpg</image435X329>
          <image624X383>https://img.mako.co.il/2020/03/01/20200210_120445_i.jpg</image624X383>
          <photographer>×× × ×ר-×× ×©××רץ</photographer>
        </item>
        <item>
          <title>×ש××× ××× ×ת ×××ש××: ×¢××××ת ענק ×-6 ××¢×××</title>
          <description>×× ×× ×©×ק×× ××× ××ר ××פ×× ××¢×××פ×צת&lt;p&gt;&lt;img src=&apos;https://img.mako.co.il/2020/03/03/IMG_0453_a.jpg&apos;/&gt;&lt;/p&gt;</description>
          <link>https://www.mako.co.il/food-recipes/recipes_column-cakes/Recipe-7f673ed9a269071026.htm?Partner=rss</link>
          <pubDate>Tue, 03 Mar 2020 07:10:00 +0200</pubDate>
          <guid>7f673ed9a2690710VgnVCM200000650a10acRCRD</guid>
          <shortDescription>×× ×× ×©×ק×× ××× ××ר ××פ×× ××¢×××פ×צת</shortDescription>
          <image>https://img.mako.co.il/2020/03/03/IMG_0453_a.jpg</image>
          <image139X80>https://img.mako.co.il/2020/03/03/IMG_0453_f.jpg</image139X80>
          <image435X329>https://img.mako.co.il/2020/03/03/IMG_0453_c.jpg</image435X329>
          <image624X383>https://img.mako.co.il/2020/03/03/IMG_0453_i.jpg</image624X383>
          <photographer>ר×× ×××× × ××</photographer>
        </item>
        <item>
          <title>××ת ×¢××ת ××× × ×ת ××××©× ×©×× ×, ×××¤×¢× ×× ×ת×××</title>
          <description>××× ××ת ×× ×¢××ת ××× × × ××× ×ת×××ת שפ×שת×?&lt;p&gt;&lt;img src=&apos;https://img.mako.co.il/2020/02/26/banana_shaishIMG_9678_a.jpg&apos;/&gt;&lt;/p&gt;</description>
          <link>https://www.mako.co.il/food-recipes/recipes_column-cakes/Recipe-2ddd4aa57718071027.htm?Partner=rss</link>
          <pubDate>Thu, 27 Feb 2020 07:10:00 +0200</pubDate>
          <guid>2ddd4aa577180710VgnVCM100000700a10acRCRD</guid>
          <shortDescription>××× ××ת ×× ×¢××ת ××× × × ××× ×ת×××ת שפ×שת×?</shortDescription>
          <image>https://img.mako.co.il/2020/02/26/banana_shaishIMG_9678_a.jpg</image>
          <image139X80>https://img.mako.co.il/2020/02/26/banana_shaishIMG_9678_f.jpg</image139X80>
          <image435X329>https://img.mako.co.il/2020/02/26/banana_shaishIMG_9678_c.jpg</image435X329>
          <image624X383>https://img.mako.co.il/2020/02/26/banana_shaishIMG_9678_i.jpg</image624X383>
          <photographer>×§×¨× ×××</photographer>
        </item>
        <item>
          <title>ק××× ××ת×: ×× ×ס×××ת ×קצ×צ×ת ×××¢×× ××ת ××××</title>
          <description>××× ×ת××× ×קצ×צ×ת ×¢×ש×× ×©××ר×ת ×פ×ר××ת&lt;p&gt;&lt;img src=&apos;https://img.mako.co.il/2020/01/09/ktsitsotP1980655_a.jpg&apos;/&gt;&lt;/p&gt;</description>
          <link>https://www.mako.co.il/food-recipes/recipes_column-vegetarian-recipes/Recipe-dbc99f869c98f61027.htm?Partner=rss</link>
          <pubDate>Wed, 26 Feb 2020 19:43:00 +0200</pubDate>
          <guid>dbc99f869c98f610VgnVCM100000700a10acRCRD</guid>
          <shortDescription>××× ×ת××× ×קצ×צ×ת ×¢×ש×× ×©××ר×ת ×פ×ר××ת</shortDescription>
          <image>https://img.mako.co.il/2020/01/09/ktsitsotP1980655_a.jpg</image>
          <image139X80>https://img.mako.co.il/2020/01/09/ktsitsotP1980655_f.jpg</image139X80>
          <image435X329>https://img.mako.co.il/2020/01/09/ktsitsotP1980655_c.jpg</image435X329>
          <image624X383>https://img.mako.co.il/2020/01/09/ktsitsotP1980655_i.jpg</image624X383>
          <photographer>×××¨× ×©×××</photographer>
        </item>
        <item>
          <title>×ת ×שקש××§× ××× ×××× ×××× ×× ×¨×§ ××©× × ×ר×××××</title>
          <description>רק תקפ××× ×©×שנ××× ×××× ×××× ×ספ×ק ××××ת×××&lt;p&gt;&lt;img src=&apos;https://img.mako.co.il/2020/02/20/shutterstock_586573883_a.jpg&apos;/&gt;&lt;/p&gt;</description>
          <link>https://www.mako.co.il/food-recipes/recipes_column-one-pot-meal/Recipe-664a6ed7d567071027.htm?Partner=rss</link>
          <pubDate>Tue, 25 Feb 2020 07:14:00 +0200</pubDate>
          <guid>664a6ed7d5670710VgnVCM100000700a10acRCRD</guid>
          <shortDescription>רק תקפ××× ×©×שנ××× ×××× ×××× ×ספ×ק ××××ת×××</shortDescription>
          <image>https://img.mako.co.il/2020/02/20/shutterstock_586573883_a.jpg</image>
          <image139X80>https://img.mako.co.il/2020/02/20/shutterstock_586573883_f.jpg</image139X80>
          <image435X329>https://img.mako.co.il/2020/02/20/shutterstock_586573883_c.jpg</image435X329>
          <image624X383>https://img.mako.co.il/2020/02/20/shutterstock_586573883_i.jpg</image624X383>
          <photographer>j.chizhe</photographer>
        </item>
        <item>
          <title>×××××× ×××ª× ×©×× ×ª×¦×××× ××פס×ק ×נשנש</title>
          <description>××פ××× ××× ×× ×¨×× ×ק××&lt;p&gt;&lt;img src=&apos;https://img.mako.co.il/2020/02/23/IMG_8618_a.jpg&apos;/&gt;&lt;/p&gt;</description>
          <link>https://www.mako.co.il/food-recipes/recipes_column-gluten-free/Recipe-5acbcb0abe17071027.htm?Partner=rss</link>
          <pubDate>Tue, 25 Feb 2020 07:00:00 +0200</pubDate>
          <guid>5acbcb0abe170710VgnVCM100000700a10acRCRD</guid>
          <shortDescription>××פ××× ××× ×× ×¨×× ×ק××</shortDescription>
          <image>https://img.mako.co.il/2020/02/23/IMG_8618_a.jpg</image>
          <image139X80>https://img.mako.co.il/2020/02/23/IMG_8618_f.jpg</image139X80>
          <image435X329>https://img.mako.co.il/2020/02/23/IMG_8618_c.jpg</image435X329>
          <image624X383>https://img.mako.co.il/2020/02/23/IMG_8618_i.jpg</image624X383>
          <photographer>ר×× ×××× × ××</photographer>
        </item>
        <item>
          <title>××סק××××××, ×§×¨× ×ת×ת××: ××¢××× ×©×× × ×ס×פ&quot;ש</title>
          <description>×× ×פ×× ×©×ר×ש ××× × ×©×ª× ×ª×× ××ת ×©× ××××¤× ×××?&lt;p&gt;&lt;img src=&apos;https://img.mako.co.il/2020/02/19/tutim_ron_yo_a.jpg&apos;/&gt;&lt;/p&gt;</description>
          <link>https://www.mako.co.il/food-recipes/recipes_column-cakes/Recipe-39d4b82d1ac5071026.htm?Partner=rss</link>
          <pubDate>Thu, 20 Feb 2020 14:00:00 +0200</pubDate>
          <guid>39d4b82d1ac50710VgnVCM200000650a10acRCRD</guid>
          <shortDescription>×× ×פ×× ×©×ר×ש ××× × ×©×ª× ×ª×× ××ת ×©× ××××¤× ×××?</shortDescription>
          <image>https://img.mako.co.il/2020/02/19/tutim_ron_yo_a.jpg</image>
          <image139X80>https://img.mako.co.il/2020/02/19/tutim_ron_yo_f.jpg</image139X80>
          <image435X329>https://img.mako.co.il/2020/02/19/tutim_ron_yo_c.jpg</image435X329>
          <image624X383>https://img.mako.co.il/2020/02/19/tutim_ron_yo_i.jpg</image624X383>
          <photographer>ר×× ×××× × ××</photographer>
        </item>
      </channel>
    </rss>
    

    This is how it looks like after parsing the content to a list:

    enter image description here

    How can I fix it?

    • Tal Barda
      Tal Barda over 3 years
      @pskink Yes. In Hebrew.
    • Tal Barda
      Tal Barda over 3 years
      @pskink I tried to parse it to a list but it stays the same. After I have the response I use the Dart XML package in order to parse the content.
    • Alex W
      Alex W over 3 years
      It's probably Mojibake
    • Tal Barda
      Tal Barda over 3 years
      @pskink text/xml
    • pskink
      pskink over 3 years
      and i suppose you are using body property? the docs say: "The body of the response as a string. This is converted from bodyBytes using the charset parameter of the Content-Type header field, if available. If it's unavailable or if the encoding name is unknown, latin1 is used by default, as per RFC 2616." - maybe you should encode bodyBytes by yourself?
    • xerx593
      xerx593 over 3 years
      ...looking at a (browser) response, it is gzip encoded...which dart should actually "auto-support" (api.flutter.dev/flutter/dart-io/HttpClient/autoUncompress.h‌​tml) ..the issue could also be "between get and output"(!?)
    • Tal Barda
      Tal Barda over 3 years
      @pskink Can you share an example which shows how to encode the bodyBytes by myself?
    • Tal Barda
      Tal Barda over 3 years
      @xerx593 What do you mean by "between get and output"?
    • xerx593
      xerx593 over 3 years
      ..i mean: (maybe) response is ok...but in further processing ..it appears gibberish(!?)
    • Tal Barda
      Tal Barda over 3 years
      @xerx593 I don't make any further processing on the response. The one attached is the one I get from the server.