Bug 149125 - [PATCH] czech accented character are not transtaled to their ASCII counterparts when adding songs to Generic Audio Player
Summary: [PATCH] czech accented character are not transtaled to their ASCII counterpar...
Status: RESOLVED FIXED
Alias: None
Product: amarok
Classification: Applications
Component: general (show other bugs)
Version: 1.4.7
Platform: Gentoo Packages Linux
: NOR wishlist
Target Milestone: ---
Assignee: Amarok Developers
URL:
Keywords:
: 145828 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-08-23 00:15 UTC by Matěj Laitl
Modified: 2008-06-16 13:24 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
amarok-1.4.7-convert-czech-accented-chars.patch (1.85 KB, patch)
2007-08-23 00:16 UTC, Matěj Laitl
Details
screenshot showing non-transliterred characters before the patch (8.71 KB, image/png)
2007-08-23 00:29 UTC, Matěj Laitl
Details
screenshot showing fixed filenames after the patch (13.67 KB, image/png)
2007-08-23 00:30 UTC, Matěj Laitl
Details
testcase mp3 file with tags with czech accented chars (352.66 KB, audio/x-mp3)
2007-08-23 00:36 UTC, Matěj Laitl
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Matěj Laitl 2007-08-23 00:15:10 UTC
Version:           1.4.7 (using KDE KDE 3.5.7)
Installed from:    Gentoo Packages
Compiler:          GCC 4.1.2 

When uploading songs to Generic Audio Device, characters with diacritics get translated to their ASCII counterparts in filenames. Howewer, most czech characters do not get translated resulting in messy filenames.

This patch just adds some more characters to translate into clearPatch function to make czech users (or listeners of czech bands) happy.

Note that this in not The Right Solution (©) (eg. it might be handled by some more complete library or so, but this is cheap and works)
Comment 1 Matěj Laitl 2007-08-23 00:16:24 UTC
Created attachment 21458 [details]
amarok-1.4.7-convert-czech-accented-chars.patch

mentioned patch against 1.4.7
Comment 2 Matěj Laitl 2007-08-23 00:29:29 UTC
Created attachment 21459 [details]
screenshot showing non-transliterred characters before the patch
Comment 3 Matěj Laitl 2007-08-23 00:30:58 UTC
Created attachment 21460 [details]
screenshot showing fixed filenames after the patch
Comment 4 Matěj Laitl 2007-08-23 00:36:24 UTC
Created attachment 21461 [details]
testcase mp3 file with tags with czech accented chars
Comment 5 Jeff Mitchell 2007-08-23 22:24:18 UTC
SVN commit 703986 by mitchell:

Fix Czech character-to-ASCII translation for Generic Media Devices.  Patch by Mate(j Laitl <strohel@gmail.com>.

BUG: 149125


 M  +3 -2      ChangeLog  
 M  +13 -4     src/app.cpp  


--- branches/stable/extragear/multimedia/amarok/ChangeLog #703985:703986
@@ -4,13 +4,14 @@
 
 VERSION 1.4.8
   BUGFIXES:
-    * Fix transferring files with UTF8 names to MTP devices.  Thanks to Kevin
+    * Fix transferring files with UTF8 names to MTP devices. Thanks to Kevin
       Becker <kevman3000@gmail.com> for the fix. (BR 139722)
     * Display warning that iPod sysinfo could not be written in the case of
       incorrect file permissions. Patch by Christian Ober-Blöbaum
       <cob@tzi.de>. (BR 148607)
+    * Fix Czech character conversion to ASCII for Generic Media Device. Patch
+      by Matěj Laitl <strohel@gmail.com>. (BR 149125)
 
-
 VERSION 1.4.7
   CHANGES:
     * Updated the Cool Streams.
--- branches/stable/extragear/multimedia/amarok/src/app.cpp #703985:703986
@@ -1355,17 +1355,26 @@
         result.replace( QChar(0x00fd), "y" ).replace( QChar(0x00dd), "Y" );
         result.replace( QChar(0x00f1), "n" ).replace( QChar(0x00d1), "N" );
 
+        // czech letters with carons
+        result.replace( QChar(0x0161), "s" ).replace( QChar(0x0160), "S" );
+        result.replace( QChar(0x010d), "c" ).replace( QChar(0x010c), "C" );
+        result.replace( QChar(0x0159), "r" ).replace( QChar(0x0158), "R" );
+        result.replace( QChar(0x017e), "z" ).replace( QChar(0x017d), "Z" );
+        result.replace( QChar(0x0165), "t" ).replace( QChar(0x0164), "T" );
+        result.replace( QChar(0x0148), "n" ).replace( QChar(0x0147), "N" );
+        result.replace( QChar(0x010f), "d" ).replace( QChar(0x010e), "D" );
+
         // accented vowels
         QChar a[] = { 'a', 0xe0,0xe1,0xe2,0xe3,0xe5, 0 };
         QChar A[] = { 'A', 0xc0,0xc1,0xc2,0xc3,0xc5, 0 };
-        QChar E[] = { 'e', 0xe8,0xe9,0xea,0xeb, 0 };
-        QChar e[] = { 'E', 0xc8,0xc9,0xca,0xcb, 0 };
+        QChar e[] = { 'e', 0xe8,0xe9,0xea,0xeb,0x11b, 0 };
+        QChar E[] = { 'E', 0xc8,0xc9,0xca,0xcb,0x11a, 0 };
         QChar i[] = { 'i', 0xec,0xed,0xee,0xef, 0 };
         QChar I[] = { 'I', 0xcc,0xcd,0xce,0xcf, 0 };
         QChar o[] = { 'o', 0xf2,0xf3,0xf4,0xf5,0xf8, 0 };
         QChar O[] = { 'O', 0xd2,0xd3,0xd4,0xd5,0xd8, 0 };
-        QChar u[] = { 'u', 0xf9,0xfa,0xfb, 0 };
-        QChar U[] = { 'U', 0xd9,0xda,0xdb, 0 };
+        QChar u[] = { 'u', 0xf9,0xfa,0xfb,0x16f, 0 };
+        QChar U[] = { 'U', 0xd9,0xda,0xdb,0x16e, 0 };
         QChar nul[] = { 0 };
         QChar *replacements[] = { a, A, e, E, i, I, o, O, u, U, nul };
 
Comment 6 Matěj Laitl 2007-08-23 22:27:39 UTC
Great, thanks much.
Comment 7 Jeff Mitchell 2007-08-23 22:33:19 UTC
Unfortunately nano performed a little UTF-to-ASCII conversion of its own...oh well.  The ChangeLog has your name right, and that's what matters :-)
Comment 8 Myriam Schweingruber 2008-06-16 13:24:02 UTC
*** Bug 145828 has been marked as a duplicate of this bug. ***