perl -MBencode=bdecode -gnE \ 'say $_->{info}{name} for bdecode $_' \ ~/.local/share/qBittorrent/BT_backup/1f1c7bab36973365cbe6572b09e0926 +abaad31a6.torrent \ | perl -pe ''
the output is:
Crysis�
(I've put the output as a paragraph, not as code, coz it doesn't display properly as code)
I need unicode support, so add -Mutf8::all, and it fails:
Even Raku/Perl6 fails:perl -MBencode=bdecode -gnE \ 'say $_->{info}{name} for bdecode $_' \ ~/.local/share/qBittorrent/BT_backup/1f1c7bab36973365cbe6572b09e0926 +abaad31a6.torrent \ | perl -Mutf8::all -pe '' Can't decode ill-formed UTF-8 octet sequence <AE>.
Raku needs adjustments:perl -MBencode=bdecode -gnE \ 'say $_->{info}{name} for bdecode $_' \ ~/.local/share/qBittorrent/BT_backup/1f1c7bab36973365cbe6572b09e0926 +abaad31a6.torrent \ | raku -e '$*IN.slurp.put' Malformed UTF-8 near bytes 69 73 ae in block <unit> at -e line 1
perl -MBencode=bdecode -gnE \ 'say $_->{info}{name} for bdecode $_' \ ~/.local/share/qBittorrent/BT_backup/1f1c7bab36973365cbe6572b09e0926 +abaad31a6.torrent \ | raku -e '$*IN.slurp(:bin).decode("utf8-c8").put'
the output is:
CrysisxAE
The torrent name in the qBittorent is shown as Crysis®
The torrent file (inside a .tgz archive):
(part of Raku issue over there https://github.com/rakudo/rakudo/issues/5606. perlmonks doesn't support uploading files?)
The main issue is the whole thing dies instead of carrying on. I would expect a warning about a malformed string, not a fatal error.
In reply to Can't decode ill-formed UTF-8 octet sequence by Veraellyunjie
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |