Summary: | KMid doesn't support international characters (AT ALL; I've checked source code and there are errors) | ||
---|---|---|---|
Product: | [Unmaintained] kmid | Reporter: | Sergey A. Galin <thelivingone> |
Component: | general | Assignee: | Antonio Larrosa <larrosa> |
Status: | RESOLVED UNMAINTAINED | ||
Severity: | normal | CC: | chalex20, fitzcarraldo1, grundleborg, null, stephan |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | 2.2.2 | |
Sentry Crash Report: | |||
Attachments: |
recodes lyrics from cp1251 to display properly
KMid patch supporting national encodings. Tuned for Russian but can be changed to support other language by modifying one line. KMid internationalization patch! KMid internationalization patch r2 |
Description
Sergey A. Galin
2003-05-04 00:02:24 UTC
For Russian users who wants to use Windows karaoke files, please also look at: http://bugs.kde.org/show_bug.cgi?id=33152 http://sage.hellmachine.net/oss/KMid-Russian.php Created attachment 2045 [details]
recodes lyrics from cp1251 to display properly
Here is a patch for kdemultimedia-3.1.1. It works for me
fine. It may work for other versions, even you can try to
modify sources by hands (only 2 additional lines and 1
changed). I can't get Sergey Galin's sources, but as it seems
he used recoding tables while mine used standart QT libraries
capabilities.
Yes, mine first uses table to convert lyrics from Windows-1251 and then calls QString::fromLocale8Bit() to convert lyrics, so it is dependent on locale. I found documentation on QTextCodec much later after I wrote that patch. I guess Artem's patch is better for temporary solution although it still doesn't make KMid internationalized. The URL I posted 2003-07-08 16:02 is wrong. The address for my Russian KMid patch is: http://sageshome.net/oss/KMid-Russian.php Just checked new patch. Works perfectly for lyrics does not depend on locale settings. But there are problems with file names containing non-ASCII characters. For example, these files are dropped from collections after few restarts of the program (somehow Russian letters get replaced with %HH notation). Also, these names are not recoded properly for KMid's man window caption. So, for users who have many files with Russian names it is more reasonable to use my patch. If you are sure that all your filenames use latin characters only, Artem's one will go better because it allows to use proportional fonts. I wish I had time to make proper patches instead of all that temporarty stuff... Again, both are hacks. The karaoke files we're talking about, they don't have any information on encoding, right? In that case, we should use QString::fromLocal8Bit and let it do the work. If you try to open a file that is not encoded in your locale, it won't work. The only way for it to work would be to do like Kate: select the encoding in the file open dialog. *** Bug 33152 has been marked as a duplicate of this bug. *** Created attachment 2046 [details]
KMid patch supporting national encodings. Tuned for Russian but can be changed to support other language by modifying one line.
Here is a new patch. Perfect Russian support including filenames stuff.
For other languages, you have to change a line in kdisptext.cpp (from line 64):
// SG
// TODO: make this to select encoding from drop-down box
lyrics_codec=QTextCodec::codecForName("CP1251");
Should be changed to
lyrics_codec=QTextCodec::codecForName("your-encoding-name");
or
lyrics_codec=QTextCodec::codecForLocale();
In latter case, the patch can be considered for official KMid version.
Re 2 Thiago Macieira : Yes, there is no way to detect encoding of lyrics in karaoke files. This makes big problem for Russian users, because 100% of Russian karaoke files are encoded in CP1251 and cannot be displayed properly under Linux. That's why I set up my Russian patch to consider that all files are in CP1251. Complete solution would be to add combo-box with list of supported encodings to main window so users could select charset manually (like in Web browser). Created attachment 2050 [details]
KMid internationalization patch!
I just couldn't stop! ;-)
Here is the 100% internationalized version with combo-box of available
encodings. By default encoding = system locale.
Bugs with improperly displayed file are names fixed too (thanks to Artem's
patch).
I hope to see the stuff in next KDE release!
Created attachment 2051 [details]
KMid internationalization patch r2
Updated internationalization patch. I removed (commented out) all encodings
which were not actually working and "Hebrew, visually ordered" (crashed KMid).
Subject: Re: KMid doesn't support international characters (AT ALL; I've checked source code and there are errors) El Mi *** Bug 52188 has been marked as a duplicate of this bug. *** CVS commit by waba: Make kmid work with Russian files (BR58083) Based on patch by Sergey A. Galin CCMAIL: 58083-done@bugs.kde.org M +36 -18 kdisptext.cpp 1.32 M +4 -1 kdisptext.h 1.17 M +26 -12 kmidclient.cpp 1.82 M +3 -1 kmidclient.h 1.32 M +4 -1 main.cpp 1.27 The patch still doesn't exist in KDE 3.2.1 :( Is it going be avaiable in the next "stable" release? I'm a bit tired to recompile kde-multimedia after each KDE upgrade... P.S. I put binaries for KDE 3.2.1 / ASP Linux 9.2 to http://sageshome.net/oss/KMid-Russian.php . Alex Chudnovsky reported that the patch was not properly applied in KDE 3.2.2! He also made a patch to apply to KDE 3.2.2 to get the correct version. It can be downloaded from http://sageshome.net/oss/KMid-Russian.php; here is a download link: http://sageshome.net/Download.php?url=ZG93bmxvYWRzL29zcy9rbWlkLWludDItR2FsaW4tQ2h1ZG5vdnNreS1LREUzLjIuMi0yMDA0MDUwNC5wYXRjaC5iejI= Oops, forgot to re-open... Is this bug still present in a recent KDE version, such as 3.5.9 or 4.0.1? (In reply to comment #18) > Is this bug still present in a recent KDE version, such as 3.5.9 or 4.0.1? > Yes, this bug is still present. I am using KMid 2.0 on KDE 3.5.9 and KMid still does not display 'international' characters. For example, it does not display any characters that have diacritic marks, such as the acute accent (á), grave accent (à), tilde accent (ã), circumflex accent (â) or cedilla (ç) to name but a few. Thus lyrics in French, Spanish, Portuguese, Turkish, etc. are not displayed correctly by KMid. (This bug is surprising given that the author of KMid is Spanish.) KMid 2.0 is now unmaintained. There is a new KMid2 version for KDE4, released as KMid 2.2.2 in 2010 March 14th. It is a rewrite from scratch, with a different architecture and some new functionalities. I'm closing this bug report because the old version is not going to be fixed, and the bug can't be reproduced in KMid2. Specifically, KMid2 handles many international character sets, most of them automatically. Some examples that have been tested are Greek http://www.greekmidi.com/songs/theodorakis/doxatotheo.html http://www.greekmidi.com/songs/theodorakis/manamoukepanagia.html Cyrillic http://midi-karaoke.info/21cd09bd.html http://midi-karaoke.info/21cd0bb1.html Chinese/Korean http://www.angelfire.com/ok/francisyeow/midi8.html Please test. Thanks. |