G'day mldvx4,
Note: I've used this common alias of mine in a couple of places:
$ alias perlu alias perlu='perl -Mstrict -Mwarnings -Mautodie=:all -Mutf8 -C -E'
There are two lines in your output that you should note. When I run your code as posted, I get:
... <description>Feed from a to ö</description> ... <title>abc...åäö</title> ...
When I add use utf8;, I get:
... <description>Feed from a to ö</description> ... <title>abc...åäö</title> ...
So, that's fixed the $feed->description():
$ perlu 'say chr hex "F6"' ö
but not the $entry->title().
Look at the difference between how you code XML::Feed->new($format) and XML::Feed::Entry->new($format). Aligning those by changing
my $entry = XML::Feed::Entry->new();
to
my $entry = XML::Feed::Entry->new('RSS');
I now get:
... <description>Feed from a to ö</description> ... <title>abc...åäö</title> ...
So, both the $feed->description() and $entry->title() are now fixed:
$ perlu 'say chr hex for qw{E5 E4 F6}' å ä ö
I'll also draw your attention to "XML::Feed: Atom feeds come out as bytes, but RSS as Unicode [rt.cpan.org #43004] #44". I haven't looked into this but it might have some relevance in relation to other XML::Feed work you may be doing.
— Ken
In reply to Re: UTF8 Output with XML::Feed?
by kcott
in thread UTF8 Output with XML::Feed?
by mldvx4
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |