Package: randomplay
Version: 0.48
Severity: wishlist
Tags: patch
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
When randomplay plays MP3s that contain non-ASCII characters in their
tags the output contains funny characters - probably UTF-8 encoded in
my ISO-8859-15 xterm [0].
Taking a look at the code I saw that the tags are read with
MP3::Info, and if I understand "perldoc MP3::Info" correct, there is
a function called use_mp3_utf8(), which defaults to true. This seems
to be the source for the UTF-8 characters. [1]
Maybe it's possible to implement a command line option /
configuration variable for ~/.randomplayrc to turn the UTF-8 output
on/off by using use_mp3_utf8() in randomplay.
*Some time later*
I've tried to implement this functionality ("(no)useutf8"), cf. the
attached patch, and first tests work for me.
Regards, gregor
[0] Just now playing:
- ---------------------
YEAR: 2002
ARTIST: Kurt Ostbahn
ALBUM: KurtiositÀten
TITLE: Nachbarn
TAGVERSION: ID3v1.1
TRACKNUM: 9
[1]
use_mp3_utf8([STATUS])
Tells MP3::Info to (or not) return TAG info in UTF-8. TRUE is 1,
FALSE is 0. Default is TRUE, if available.
...
- -- System Information:
Debian Release: testing/unstable
APT prefers unstable
APT policy: (990, 'unstable'), (500, 'testing'), (500, 'stable')
Architecture: i386 (i686)
Shell: /bin/sh linked to /bin/bash
Kernel: Linux 2.6.14.200510301955
Locale: LANG=C, [EMAIL PROTECTED] (charmap=ISO-8859-15)
Versions of packages randomplay depends on:
ii libdate-calc-perl 5.4-4 Perl library for accessing dates
ii libmp3-info-perl 1.13-1 Perl MP3::Info - Manipulate / fetc
ii libogg-vorbis-header-perl 0.03-1 perl interface to Ogg Vorbis infor
ii libterm-readkey-perl 2.30-2 A perl module for simple terminal
ii perl 5.8.7-7 Larry Wall's Practical Extraction
Versions of packages randomplay recommends:
ii mpg321 0.2.10.3 A Free command-line mp3 player, co
ii vorbis-tools 1.0.1-1.5 Several Ogg Vorbis Tools
- -- debconf-show failed
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
iD8DBQFDbhHFOzKYnQDzz+QRAm7XAKCED8vvRBZv/OdGyxpeQH8gBmxcVwCglFbO
J7D/9XzmYrkFa1TcNsCVof4=
=otAt
-----END PGP SIGNATURE-----
--- /usr/bin/randomplay.0.48 2005-11-06 14:53:01.000000000 +0100
+++ /usr/bin/randomplay 2005-11-06 15:12:38.000000000 +0100
@@ -43,2 +43,3 @@
my $remember = 1;
+my $useutf8 = 1;
my $maxsize = 0;
@@ -131,2 +132,4 @@
/^\s*noremember/i || /^\s*remember[\s=]*(no|off|false)/i and $remember =
0;
+ /^\s*useutf8/i and $useutf8 = 1;
+ /^\s*nouseutf8/i || /^\s*useutf8[\s=]*(no|off|false)$/i and $useutf8 = 0;
/^\s*weight/i and $weight_favorites = 1;
@@ -159,2 +162,3 @@
'remember!' => \$remember,
+ 'useutf8!' => \$useutf8,
'last=i' => \$last_played,
@@ -347,4 +351,5 @@
if (/mp3$/i) { # and smarter with
presentation and support other tags
+ MP3::Info::use_mp3_utf8($useutf8);
my $tag = get_mp3tag($_);
- while (my ($k, $v) = each %{$tag}) {
+ while (my ($k, $v) = each %{$tag}) {
$song_info .= $k . ": " . $v . "\n" if $v;
@@ -460,2 +465,4 @@
--noremember
+ --useutf8 use UTF-8 encoding for output (default
useutf8)
+ --nouseutf8
-w, --weight weight random shuffle to prefer songs
rated as favorites (default weight)