Veraellyunjie has asked for the wisdom of the Perl Monks concerning the following question:
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Can't decode ill-formed UTF-8 octet sequence
by ikegami (Patriarch) on Jul 17, 2024 at 05:27 UTC | |
by ikegami (Patriarch) on Jul 17, 2024 at 15:31 UTC | |
|
Re: Can't decode ill-formed UTF-8 octet sequence
by NERDVANA (Priest) on Jul 17, 2024 at 15:51 UTC | |
|
Re: Can't decode ill-formed UTF-8 octet sequence
by cavac (Prior) on Jul 25, 2024 at 08:09 UTC | |
|
Re: Can't decode ill-formed UTF-8 octet sequence
by sectokia (Friar) on Jul 18, 2024 at 03:36 UTC |