mldvx4 has asked for the wisdom of the Perl Monks concerning the following question:
Hello. I would like to have the XML::Feed produce UTF-8 but after experimenting a bit and searching a great many web pages, I feel stumped -- again. :/
Below is a sample which generates escaped characters in the feed title instead of showing UTF8. I would like it to generate proper "едц" characters instead of "åäö" it currently makes.
#!/usr/bin/perl use open ':encoding(utf8)'; use XML::Feed; use English; use strict; use warnings; my $feed = XML::Feed->new('RSS'); $feed->title('Feed'); $feed->link('https://www.example.com/feed.rss'); $feed->language('en'); $feed->description('Feed from a to ц'); my $entry = XML::Feed::Entry->new(); $entry->link('https://www.example.com/one.html'); $entry->title('abc...едц'); $feed->add_entry($entry); print $feed->as_xml; exit(0)
Can I pass an open file handle to XML::Feed somehow? Or what is a correct method?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: UTF8 Output with XML::Feed?
by kcott (Archbishop) on Mar 07, 2022 at 18:07 UTC | |
by ikegami (Patriarch) on Mar 07, 2022 at 18:27 UTC | |
|
Re: UTF8 Output with XML::Feed? (use utf8)
by LanX (Saint) on Mar 07, 2022 at 14:36 UTC | |
by mldvx4 (Hermit) on Mar 07, 2022 at 17:55 UTC | |
by kcott (Archbishop) on Mar 07, 2022 at 18:47 UTC | |
by LanX (Saint) on Mar 07, 2022 at 20:09 UTC | |
by pryrt (Abbot) on Mar 07, 2022 at 20:28 UTC | |
| |
by kcott (Archbishop) on Mar 08, 2022 at 01:44 UTC | |
by LanX (Saint) on Mar 07, 2022 at 20:02 UTC |