| Summary: | Transliteration of ID3v1 tags to ASCII | ||
|---|---|---|---|
| Product: | [Applications] kid3 | Reporter: | Martin Mareš <mj> |
| Component: | general | Assignee: | Urs Fleisch <ufleisch> |
| Status: | RESOLVED FIXED | ||
| Severity: | wishlist | CC: | mj |
| Priority: | NOR | ||
| Version First Reported In: | unspecified | ||
| Target Milestone: | --- | ||
| Platform: | Other | ||
| OS: | Linux | ||
| Latest Commit: | https://invent.kde.org/kde/kid3/commit/c9e570d745b1ba1f541aa21e481bd195009cd704 | Version Fixed/Implemented In: | |
| Sentry Crash Report: | |||
| Attachments: |
QML script to transliterate contents of ID3v1 tags to ASCII
An improved version of the script which handles all extended Latin characters A script used to generate the transliteration tables |
||
|
Description
Martin Mareš
2020-04-05 10:55:56 UTC
I also try to have ID3v1 tags on all of my MP3 files and only have ASCII characters in them. The encodings which are available in the "Tags/Tag 1" tab (option "Text encoding") of the settings are those provided by QTextCodec, see https://doc.qt.io/qt-5/qtextcodec.html#details. ASCII is not listed there, but this should be no problem since a lot of the supported encodings share the first half of their characters with ASCII, so you can take ISO-8859-1 for example. To find an appropriate encoding, you could use "Text Encoding ID3v1" from the file list context menu. To reduce the characters in the chosen 8-bit encoding to ASCII, you will have to replace all characters of the second half with an appropriate ASCII sequence. I do not know Czech, but I sometimes have characters with German Umlauts, which I replace using the "String replacement" table in the "Files" tab of the settings, to do so, I have to generate the file names from the "Tag 1" tags, I then apply the file name format which uses the "String replacement" mentioned above ("Tools/Apply Filename Format") - I want the file names to contain only ASCII characters too - and then I generate the tags from the file names. This is a bit awkward, but you could use the "String replacement" table from the "Tags/All Tags" tab in the settings to have the required transliteration and then use "Tools/Apply Tag Format". The problem here will be that it will also change the "Tag 2", but you could avoid this by only checking the "Track Number" row in the "Tag 2" table (having nothing selected means all is selected), so the translitation will be applied to "Tag 1" and to the "Track Number" of "Tag 2" (which will not change anything since it contains only numbers). Created attachment 127486 [details]
QML script to transliterate contents of ID3v1 tags to ASCII
I have attached a QML script to transliterate the contents of the ID3v1 tag to ASCII. Just store it somewhere and then go to the "User Actions" settings in Kid3 and add it with name "Tag 1 to ASCII" and command "@qml /path/to/Tag1ToAscii.qml". You can then invoke it using the file list context menu or assign it to a keyboard shortcut in the settings. Git commit 211dfa1371737460873b4a9887b92f1ef083658f by Urs Fleisch. Committed on 13/04/2020 at 11:18. Pushed by ufleisch into branch 'devel'. Script to transliterate ID3v1 tags to ASCII A +175 -0 src/qml/script/Tag1ToAscii.qml [License: LGPL] https://invent.kde.org/kde/kid3/commit/211dfa1371737460873b4a9887b92f1ef083658f Thanks for the report. I have fixed it in Git [cf8a234c]. For a workaround with the current version, use "Open Folder" instead of "Open". Sorry, forget "Comment 5", it was meant for another bug report. Created attachment 127493 [details]
An improved version of the script which handles all extended Latin characters
Created attachment 127494 [details]
A script used to generate the transliteration tables
Thanks, the script solves my problems. I am attaching a version of the script with transliteration table extended to all accented Latin characters, so it is no longer limited to iso-8859-1. I am also attaching a simple Perl script I used to generate the table using iconv. Git commit c9e570d745b1ba1f541aa21e481bd195009cd704 by Urs Fleisch. Committed on 14/04/2020 at 06:42. Pushed by ufleisch into branch 'master'. Script to transliterate ID3v1 tags to ASCII M +5 -0 doc/en/index.docbook M +4 -0 src/core/config/useractionsconfig.cpp M +1 -0 src/qml/CMakeLists.txt A +613 -0 src/qml/script/Tag1ToAscii.qml [License: LGPL] https://invent.kde.org/kde/kid3/commit/c9e570d745b1ba1f541aa21e481bd195009cd704 Thanks for your contribution. I have adapted it to replace all characters in these blocks and committed the script to Git. Fixed in version 3.8.3. |