# Replace diacritics within folder names

**URL:** <https://community.mp3tag.de/t/replace-diacritics-within-folder-names/51937>\
**Category:** Support\
**Created:** [February 9, 2021, 2:52pm UTC](https://community.mp3tag.de/t/replace-diacritics-within-folder-names/51937 "2021-02-09T14:52:09Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Apesbrain](https://community.mp3tag.de/user_avatar/community.mp3tag.de/apesbrain/32/21_2.png) [@Apesbrain](https://community.mp3tag.de/u/Apesbrain)\
**Post date:** [February 9, 2021, 2:52pm UTC](https://community.mp3tag.de/t/replace-diacritics-within-folder-names/51937/1 "2021-02-09T14:52:09Z")

</div>

I have succeeded in replacing diacritics within filenames, but is there a way to do the same with folder/subfolder names? Thanks.

---

<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:** [February 10, 2021, 6:51pm UTC](https://community.mp3tag.de/t/replace-diacritics-within-folder-names/51937/2 "2021-02-10T18:51:57Z")

</div>

Try an action of the type "Format value" for \_DIRECTORY where you $replace(%\_path%,....)

---

<div class="post-metadata">

**Author:** ![Apesbrain](https://community.mp3tag.de/user_avatar/community.mp3tag.de/apesbrain/32/21_2.png) [@Apesbrain](https://community.mp3tag.de/u/Apesbrain)\
**Post date:** [February 10, 2021, 8:36pm UTC](https://community.mp3tag.de/t/replace-diacritics-within-folder-names/51937/3 "2021-02-10T20:36:24Z")

</div>

Thanks for your reply. I've tried with one character in bottom half below, but it's not working. The top half is the Action to replace diacritics in FILENAME. Any hints on what I've done wrong?

 ![Clipboard01](https://community.mp3tag.de/uploads/default/original/2X/f/fea4c396c4b8ac60c1387609d439a3038db02a70.jpeg)

---

<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:** [February 10, 2021, 8:45pm UTC](https://community.mp3tag.de/t/replace-diacritics-within-folder-names/51937/4 "2021-02-10T20:45:52Z")

</div>

You know that you can test such an expression in Convert \> Tag-Tag.  
Perhaps you could try %\_directory% instead of %\_path% - even though this replaces only in the current directory. I am not sure if that is the scope that you want to manipulate or whether that is the whole path.

---

<div class="post-metadata">

**Author:** ![Apesbrain](https://community.mp3tag.de/user_avatar/community.mp3tag.de/apesbrain/32/21_2.png) [@Apesbrain](https://community.mp3tag.de/u/Apesbrain)\
**Post date:** [February 11, 2021, 12:16am UTC](https://community.mp3tag.de/t/replace-diacritics-within-folder-names/51937/5 "2021-02-11T00:16:39Z")

</div>

Thanks for the suggestion, $replace(%\_path%,Æ,AE) works in Tag-Tag. Is there a way in this single command to have more than one "from" value to be replaced by that "to"?

For instance: ā\ă\ą all convert to a.

---

<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:** [February 11, 2021, 5:25am UTC](https://community.mp3tag.de/t/replace-diacritics-within-folder-names/51937/6 "2021-02-11T05:25:32Z")

</div>

> [@Apesbrain](#):
>
> Is there a way in this single command to have more than one "from" value to be replaced by that "to"?

Please see the help on [scripting functions](https://docs.mp3tag.de/scripting/#string-functions). You can add (up to 32?) pairs in a single function call.

---

<div class="post-metadata">

**Author:** ![Apesbrain](https://community.mp3tag.de/user_avatar/community.mp3tag.de/apesbrain/32/21_2.png) [@Apesbrain](https://community.mp3tag.de/u/Apesbrain)\
**Post date:** [February 12, 2021, 12:05am UTC](https://community.mp3tag.de/t/replace-diacritics-within-folder-names/51937/7 "2021-02-12T00:05:58Z")

</div>

Have made some progress. The "Remove Diacritics From FILENAME" Action below works well. It started with someone else's work on the forum to which I added some missing characters. The "Remove Diacritics From DIRECTORY" Action does NOT yet work. Any suggestions with regard to the latter are welcome. Thanks.

[Remove Diacritics From DIRECTORY.mta](https://community.mp3tag.de/uploads/short-url/jrcZb7ZfWk7kKG36cedwilrN7LE.mta) (3.8 KB) [Remove Diacritics From FILENAME.mta](https://community.mp3tag.de/uploads/short-url/wdkVMJRtoWe8f2fwr8mXib8atIJ.mta) (9.2 KB)

---

<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:** [February 12, 2021, 5:36am UTC](https://community.mp3tag.de/t/replace-diacritics-within-folder-names/51937/8 "2021-02-12T05:36:31Z")

</div>

As I said: you can test your expressions in Convert\>Tag-Tag. So I would check there where and what the problem is.  
Also, it would be nice if you could describe what does not yet work.

---

<div class="post-metadata">

**Author:** ![Apesbrain](https://community.mp3tag.de/user_avatar/community.mp3tag.de/apesbrain/32/21_2.png) [@Apesbrain](https://community.mp3tag.de/u/Apesbrain)\
**Post date:** [February 12, 2021, 12:58pm UTC](https://community.mp3tag.de/t/replace-diacritics-within-folder-names/51937/9 "2021-02-12T12:58:30Z")

</div>

When testing with Tag-Tag, this replace works:  
\_DIRECTORY  
$replace(%\_path%,À,A,Á,A,Â,A,Ã,A,Ä,A,Å,A,Ā,A,Ă,A,Ą,A)

But this one does not:  
\_DIRECTORY  
$replace(%\_path%,\u00c0,A,\u00c1,A,\u00c2,A,\u00c3,A,\u00c4,A,\u00c5,A,\u0100,A,\u0102,A,\u0104,A)

Yet, when you input the first into an Mp3tag Action it saves it as the second. If I edit the MTA file that Mp3tag creates for this Action and replace the second with the first, that does not work either. By "not work" I mean that the characters are not replaced. Thanks again.

---

<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:** [February 12, 2021, 2:52pm UTC](https://community.mp3tag.de/t/replace-diacritics-within-folder-names/51937/10 "2021-02-12T14:52:24Z")

</div>

So I would note these things:  
editing mta files directly with a text editor is apparently no good idea.  
The $replace() function needs printable characters and no character codes.

---

<div class="post-metadata">

**Author:** ![Florian](https://community.mp3tag.de/user_avatar/community.mp3tag.de/florian/32/5759_2.png) [@Florian](https://community.mp3tag.de/u/Florian)\
**Post date:** [February 12, 2021, 3:19pm UTC](https://community.mp3tag.de/t/replace-diacritics-within-folder-names/51937/11 "2021-02-12T15:19:33Z")

</div>

> [@ohrenkino](#):
>
> Try an action of the type "Format value" for \_DIRECTORY where you $replace(%\_path%,....)

This is where both of you went in the wrong direction. `%_path%` always contains the complete file path and setting this to `_DIRECTORY` makes no sense.

`_DIRECTORY` refers to the folder name in which the file is located and you can use `$replace(%_directory%,...)` to replace the diacritics within this parent folder name of the file.

If you need to address the whole folder path of the file, `$replace(%_folderpath%,...)` should work too (although, that's more of an undocumented feature).

---

<div class="post-metadata">

**Author:** ![Apesbrain](https://community.mp3tag.de/user_avatar/community.mp3tag.de/apesbrain/32/21_2.png) [@Apesbrain](https://community.mp3tag.de/u/Apesbrain)\
**Post date:** [February 12, 2021, 3:57pm UTC](https://community.mp3tag.de/t/replace-diacritics-within-folder-names/51937/12 "2021-02-12T15:57:20Z")

</div>

Thank you both. $replace(%\_folderpath%,...) does work, but it does not change the filename itself. Is there a way to include the filename, or can this Action call out to another Action (the "Remove from FILENAME" one)?

Finally, how would I incorporate this into the standard "Tag - Filename" Action that I use all the time? I'd like it to just be my "standard" way of doing this.

---

<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:** [February 12, 2021, 5:06pm UTC](https://community.mp3tag.de/t/replace-diacritics-within-folder-names/51937/13 "2021-02-12T17:06:43Z")

</div>

> [@Apesbrain](#):
>
> Finally, how would I incorporate this into the standard "Tag - Filename" Action that I use all the time?

I think that as you have several steps that manipulate the filename, I would suggest that you

- construct a filename in a user-defined field e.g. my\_filename
- treat the contents of this field (my\_filename) with all the actions to smoothe the characters
- use the finalized string from my\_filename to write the real \_FILENAME as with Tag-Filename
- delete the user-defined field my\_filename

---

<div class="post-metadata">

**Author:** ![Apesbrain](https://community.mp3tag.de/user_avatar/community.mp3tag.de/apesbrain/32/21_2.png) [@Apesbrain](https://community.mp3tag.de/u/Apesbrain)\
**Post date:** [February 13, 2021, 2:07pm UTC](https://community.mp3tag.de/t/replace-diacritics-within-folder-names/51937/14 "2021-02-13T14:07:07Z")

</div>

The attached Action replaces diacritics in filename and folder names. Feel free to use if you need. If you discover any missing characters, please post back here. Thanks.

[Replace PATH Diacritics.mta](https://community.mp3tag.de/uploads/short-url/dbmqxCM76Venkb8I1EtWERpMcv5.mta) (8.0 KB)

P.S. Here is another way of accomplishing this:

> **[Diacritics Remover](https://sourceforge.net/projects/diacriticsremov/)**
>
> Download Diacritics Remover for free. Diacritics Remover can remove diacritics from selected files/folder names. It is good for example if you uploading files to server and server doesn\`t support diacritics.

This became a problem for me when one of my mobile apps would not properly handle files with these characters. Diacritics in the tags were ok, but not in the file system.

---

<div class="post-metadata">

**Author:** ![system](https://community.mp3tag.de/uploads/default/original/2X/c/ce7035d426cb755a7916793326d23b465222a407.png) [@system](https://community.mp3tag.de/u/system)\
**Post date:** [February 9, 2026, 12:29pm UTC](https://community.mp3tag.de/t/replace-diacritics-within-folder-names/51937/15 "2026-02-09T12:29:04Z")

</div>


