# Request for to\_plain\_latin() conversion function

**URL:** https://community.mp3tag.de/t/request-for-to-plain-latin-conversion-function/15063
**Category:** General Discussion
**Created:** [September 27, 2013, 8:55am UTC](https://community.mp3tag.de/t/request-for-to-plain-latin-conversion-function/15063 "2013-09-27T08:55:45Z")
**Posts on this page:** 17
**Page:** 1

<div class="post-metadata">

### Author: ![glorifyday](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/g/bb73d2/32.png) [@glorifyday](https://community.mp3tag.de/u/glorifyday)
#### Post date: [September 27, 2013, 8:55am UTC](https://community.mp3tag.de/t/request-for-to-plain-latin-conversion-function/15063/1 "2013-09-27T08:55:45Z")

</div>

I'm new here, so I would like to say hello first ;-).

I would like to make a request for a conversion function that converts all national characters to Latin counterparts (if possible), leaving Latin and unknown characters intact. The first version might handle just European characters (I believe I read somewhere that this could be done with some Win32 API, but I am not sure), in the next versions the list of recognised characters could become longer.

I understand that this could be achieved with series of replacements right now, but this is not very comfortable, especially if you would like to define transformation for all European languages.

Rationale:  
I would like to use this function in the "Convert -\> Tag - Filename" context.  
Although we normally use national characters in tags, the file names are much easier to handle without them, because especially when transferred between various servers and operating systems, the national characters often get lost or converted to something unreadable. And the media players often have very basic, lightweight OSes.

Please consider adding this function. Should be easy to implement, and I find it extremely usable.

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [September 27, 2013, 3:59pm UTC](https://community.mp3tag.de/t/request-for-to-plain-latin-conversion-function/15063/2 "2013-09-27T15:59:08Z")

</div>

Did you have a look at the  
$validate()  
function? It helps to create legal filenames.

Also, there is the $replace() function that allows you to create longish lists of pairs of characters that should replace each other.  
This function could help you get those translations. Yet, you have to do it according to your requirements.  
Both functions can be used in conjunction with the Convert-function in the menu as well as the format value actions.

---

<div class="post-metadata">

### Author: ![glorifyday](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/g/bb73d2/32.png) [@glorifyday](https://community.mp3tag.de/u/glorifyday)
#### Post date: [September 27, 2013, 7:12pm UTC](https://community.mp3tag.de/t/request-for-to-plain-latin-conversion-function/15063/3 "2013-09-27T19:12:12Z")

</div>

Thanks for your answer.  
Yes, I know about the two functions and I am aware that this is a workaround, yet creating a replace expression that is good for - say - all European languages would be quite a nasty job.

My request is motivated by the fact that this new function should be quite easy to implement and maintain for the developers, and a very useful "out-of-the-box" tool for the users.

That's only my suggestion anyway, let the Mp3tag developer(s) decide.

---

<div class="post-metadata">

### Author: ![glorifyday](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/g/bb73d2/32.png) [@glorifyday](https://community.mp3tag.de/u/glorifyday)
#### Post date: [October 3, 2024, 1:46am UTC](https://community.mp3tag.de/t/request-for-to-plain-latin-conversion-function/15063/4 "2024-10-03T01:46:07Z")

</div>

Hi, I found a nice python library that does the job of "latinising" various alphabets. It's called Unidecode:

> **[Unidecode](https://pypi.org/project/Unidecode/)**
>
> ASCII transliterations of Unicode text

A C port is available (C#, too).

> **[GitHub - marekru/unidecode: C++ port of the Text::Unidecode Perl module, which...](https://github.com/marekru/unidecode)**
>
> C++ port of the Text::Unidecode Perl module, which provides pure ASCII transliterations of Unicode strings.

Can this be included in mp3tag in the future?

---

<div class="post-metadata">

### Author: ![LyricsLover](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/c6cbf5/32.png) [@LyricsLover](https://community.mp3tag.de/u/LyricsLover)
#### Post date: [October 3, 2024, 6:28am UTC](https://community.mp3tag.de/t/request-for-to-plain-latin-conversion-function/15063/5 "2024-10-03T06:28:06Z")

</div>

After a brief look at this library, I'm not sure if this is really useful when they say:

> A user expects a character to be transliterated in their language but Unidecode uses a transliteration for a different language. **It’s best to not use Unidecode for strings that are directly visible to users of your application.**

As an example from their FAQ:

> _German umlauts are transliterated incorrectly_  
> Latin letters “a”, “o” and “u” with diaeresis are transliterated by Unidecode as “a”, “o”, “u”, _not_ according to German rules “ae”, “oe”, “ue”. This is intentional and will not be changed. Rationale is that these letters are used in languages other than German (for example, Finnish and Turkish). German text transliterated without the extra “e” is much more readable than other languages transliterated using German rules

I doubt that many German users would agree with the last sentence.

German words with umlauts like  
Städte -\> Staedte -\> Stadte  
Dörfer -\> Doerfer -\> Dorfer  
Kühe -\> Kuehe -\> Kuhe  
reduced to the base character are indeed less readable - at least for German readers.

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [October 3, 2024, 6:31am UTC](https://community.mp3tag.de/t/request-for-to-plain-latin-conversion-function/15063/6 "2024-10-03T06:31:30Z")

</div>

It is a distorting difference if  
Er machte Löcher (he made holes)  
becomes  
Er machte Locher (he made perforators)

Or Nöte (woes) vs. Note (note)  
Apfel (singular) vs. Äpfel (plural)

Don't know, though, how many tags feature these words.

---

<div class="post-metadata">

### Author: ![LyricsLover](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/c6cbf5/32.png) [@LyricsLover](https://community.mp3tag.de/u/LyricsLover)
#### Post date: [October 3, 2024, 6:36am UTC](https://community.mp3tag.de/t/request-for-to-plain-latin-conversion-function/15063/7 "2024-10-03T06:36:11Z")

</div>

Another example:

Kaffee rösten (roast coffee)  
Eisenträger rosten (rusting iron girders)

One example that could be very offending:

Die Luft ist schwül (The air is humid)  
Dieser Mann ist schwul (This man is gay)

---

<div class="post-metadata">

### Author: ![glorifyday](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/g/bb73d2/32.png) [@glorifyday](https://community.mp3tag.de/u/glorifyday)
#### Post date: [October 3, 2024, 11:07am UTC](https://community.mp3tag.de/t/request-for-to-plain-latin-conversion-function/15063/8 "2024-10-03T11:07:52Z")

</div>

Thanks for your feedback. Having in mind all the drawbacks, I still think availability of 'unidecode' might be useful. Please note that it would be used to change file names, not the tags. Filenames in a plain ASCII are just safe across various operating and file systems, and decently readable in most of them. And a 'decent readability' is enough for a file name in my opinion.

As for me... I would use this function if it were available.

(In fact, I made a small C# program using the C# port of this library, and am using it regularly, but haing this possibility integrated in mp3tag would be nice)  
[https://bitbucket.org/DimaStefantsov/unidecodesharpfork/src/master/](https://bitbucket.org/DimaStefantsov/unidecodesharpfork/src/master/)

---

<div class="post-metadata">

### Author: ![LyricsLover](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/c6cbf5/32.png) [@LyricsLover](https://community.mp3tag.de/u/LyricsLover)
#### Post date: [October 3, 2024, 12:02pm UTC](https://community.mp3tag.de/t/request-for-to-plain-latin-conversion-function/15063/9 "2024-10-03T12:02:29Z")

</div>

I'm just curious:  
What kind of "conversion" would this tool do with Unicode characters like in [this album](https://musicbrainz.org/release/16e7a789-bcd8-4555-8a4b-e07121a90938) if the filename for the titles would be converted?

 ![image](https://community.mp3tag.de/uploads/default/original/3X/6/5/65cd621b0ae640abbf4866deafeb226896b164bb.png)

---

<div class="post-metadata">

### Author: ![LyricsLover](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/c6cbf5/32.png) [@LyricsLover](https://community.mp3tag.de/u/LyricsLover)
#### Post date: [October 3, 2024, 12:09pm UTC](https://community.mp3tag.de/t/request-for-to-plain-latin-conversion-function/15063/10 "2024-10-03T12:09:28Z")

</div>

> [@glorifyday](#):
>
> In fact, I made a small C# program using the C# port of this library, and am using it regularly, but haing this possibility integrated in mp3tag would be nice

Until such an integration, you could use it as [new entry in Tools](https://docs.mp3tag.de/customization/options/tools/) (if your C# program is an executable command line tool).

---

<div class="post-metadata">

### Author: ![glorifyday](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/g/bb73d2/32.png) [@glorifyday](https://community.mp3tag.de/u/glorifyday)
#### Post date: [October 3, 2024, 12:25pm UTC](https://community.mp3tag.de/t/request-for-to-plain-latin-conversion-function/15063/11 "2024-10-03T12:25:59Z")

</div>

It's a GUI program, but I can rewrite it, no problem.  
The python unidecode tool is available as a command line, too.

Btw. you can install it with:  
pip install unidecode  
and check on the files that you mention:  
ls | unidecode

---

<div class="post-metadata">

### Author: ![LyricsLover](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/c6cbf5/32.png) [@LyricsLover](https://community.mp3tag.de/u/LyricsLover)
#### Post date: [October 3, 2024, 12:29pm UTC](https://community.mp3tag.de/t/request-for-to-plain-latin-conversion-function/15063/12 "2024-10-03T12:29:05Z")

</div>

Sorry, I don't use python or PIP on my windows system 😉

You could manually rename one of your example songs to  
01 - 🪐  
or  
09 - 🌎  
and check the result of the conversion with your tool.

---

<div class="post-metadata">

### Author: ![glorifyday](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/g/bb73d2/32.png) [@glorifyday](https://community.mp3tag.de/u/glorifyday)
#### Post date: [October 3, 2024, 12:37pm UTC](https://community.mp3tag.de/t/request-for-to-plain-latin-conversion-function/15063/13 "2024-10-03T12:37:58Z")

</div>

If I try to copy this to notepad or notepad++, I get:

01 - : ringer\_planet :  
or  
09 - : earth\_americas :

(I manually added spaces before and after colons, otherwise the forum treats and displays these strings as icons)

It's the same when I try to paste the characters into the linux (Putty) console, for instance:  
mkdir : ringer\_planet :

I would need to know the unicode numbers and use them, I guess...

How does dir command list these files?

---

<div class="post-metadata">

### Author: ![LyricsLover](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/c6cbf5/32.png) [@LyricsLover](https://community.mp3tag.de/u/LyricsLover)
#### Post date: [October 3, 2024, 12:44pm UTC](https://community.mp3tag.de/t/request-for-to-plain-latin-conversion-function/15063/14 "2024-10-03T12:44:15Z")

</div>

> [@glorifyday](#):
>
> Filenames in a plain ASCII are just safe across various operating and file systems

Maybe I just don't understand the purpose of the library?  
Should it convert any NON-ASCII-character to an ASCII-Character?  
Or is the library name "Unidecode" just misleading for me?

> [@glorifyday](#):
>
> How does dir command list these files?

![image](https://community.mp3tag.de/uploads/default/original/3X/a/3/a37f42913486cc58622904a69ec7bd6b7aca0da7.png)

CMD-Window with Font "Consolas":  
 ![image](https://community.mp3tag.de/uploads/default/original/3X/4/8/48fa09c06f575f89910601426758a4ac297d18f8.png)

If I redirect the output of DIR in a `test.txt` file, the content of `test.txt` looks like  
 ![image](https://community.mp3tag.de/uploads/default/original/3X/b/a/baea812d98a8d5114fdfdd6eea52fd2cc951f175.png)

---

<div class="post-metadata">

### Author: ![glorifyday](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/g/bb73d2/32.png) [@glorifyday](https://community.mp3tag.de/u/glorifyday)
#### Post date: [October 3, 2024, 1:00pm UTC](https://community.mp3tag.de/t/request-for-to-plain-latin-conversion-function/15063/15 "2024-10-03T13:00:55Z")

</div>

Luckily, I found this album in my collection. Unidecode will not help in this case:

PS E:\Doc\MMedia\Music\Coldplay\2021 - Music Of The Spheres\> ls -n  
01 ⦵.flac  
02 Higher Power.flac  
03 Humankind.flac  
04 -✧.flac  
05 Let Somebody Go.flac  
06 ❤.flac  
07 People of The Pride(Explicit).flac  
08 Biutyful.flac  
09 ❍.flac  
10 My Universe.flac  
11 ∞.flac  
12 Coloratura.flac

PS E:\Doc\MMedia\Music\Coldplay\2021 - Music Of The Spheres\> ls -n | unidecode  
01 ?.flac  
02 Higher Power.flac  
03 Humankind.flac  
04 -?.flac  
05 Let Somebody Go.flac  
06 ?.flac  
07 People of The Pride(Explicit).flac  
08 Biutyful.flac  
09 ?.flac  
10 My Universe.flac  
11 ?.flac  
12 Coloratura.flac

(note that the forum displays icons on the output of plain ls -n, but in the console they are not visible - I see rectangles instead)

---

<div class="post-metadata">

### Author: ![LyricsLover](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/c6cbf5/32.png) [@LyricsLover](https://community.mp3tag.de/u/LyricsLover)
#### Post date: [October 3, 2024, 1:15pm UTC](https://community.mp3tag.de/t/request-for-to-plain-latin-conversion-function/15063/16 "2024-10-03T13:15:28Z")

</div>

Thank you for your test.

> [@glorifyday](#):
>
> Unidecode will not help in this case

Just to be sure:  
Is this the expected result or should "unidecode" convert such Unicode characters too?

---

<div class="post-metadata">

### Author: ![glorifyday](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/g/bb73d2/32.png) [@glorifyday](https://community.mp3tag.de/u/glorifyday)
#### Post date: [October 3, 2024, 2:29pm UTC](https://community.mp3tag.de/t/request-for-to-plain-latin-conversion-function/15063/17 "2024-10-03T14:29:24Z")

</div>

I'm not sure and can only guess that the original intention of the author was to 'latinise' symbols that are alphabetic. Not all unicode symbols. So this result, although not satisfying, might be expected.

Anyway, if such a function is available in mp3tag, the user has a preview option before renaming files, so (s)he can decide to use it or not on a particular set of files. I believe that in most cases it would still be useful.
