Replace Accents

Is there a way to remove accents without creating a replace action for each letter.

I want to replace all "á é í ó ú" with "a e i o u"

Is creating replace actions for each letter under an action group the only way to achieve this. :unsure:

Is creating replace actions for each letter under an action group the
only way to achieve this.

I'd say Yes, given Florian (Mp3tag developer)'s reply to the similar question at: Reducing filename to ASCII

If you want to cover uppercase too, you'll need separate Replace actions for those. Also you might want to add ñ and ü.

By the way, if your goal is pathname compatibility or string comparability, $ansi() might do the job better - it is a lot more concise, and covers other possibly non-Extended ASCII characters too.

Is there a table list anywhere in the documentation to see what $ansi() converts in reality char by char?


Yes I'll love to learn more about it can you point us to the right direction.

$ansi() converts the given string using the current system codepage. So there is no fixed list of characters since the result depends on the host system's active codepage.

I'd be interested to know it's unicode>CP mapping. If the operation corresponds to a Windows API function, could you tell us which?

Hi, I tired to use the $ansi() function in the parameter of a tool, but doesn't seem to work.

The tool is this (inspired by this post):$replace($ansi(%album%), ,+)

I also tried the other way round, just in case, but I doesn't work either:$ansi($replace(%album%, ,+))

Name of the tool (for those interested): AMG - Album
Path: pointing to "firefox.exe"
[ ] for all selected files (not marked)

There seems to be only one way to correct this for me (veeeeeery ad hoc, let's say):$replace($replace($replace($replace($replace($replace(%album%, ,+),á,a),é,e),í,i),ó,o),ú,u)

The album in question is "Verve Jazz Masters 11: Stéphane Grappelli", so the idea of using several $replace function works, but I'd need to modifiy it to allow other characters every time I need it. That's very tedious.

Any other idea?

$ansi only deals with caracters that do not fit in your system codepage
For example win1252 which you probably have:
All these characters stay the same.

Btw $replace does not have to be nested:
$replace(%album%, ,+,á,a,é,e,í,i,ó,o,ú,u)

That's much better, it would be worth adding it to the help file. :wink:
And a function to perform this in a simpler way (directily) would be welcome too.

Thanks dano


Florian, could you please make this function override official? It is not mentioned anywhere in the Help as far as I can see. Thanks.

It's already mentioned at Help > Scripting functions.

Oh OK! Sorry.

Not a problem at all :slight_smile:

I know this is an old topic, but I wanted to add some thoughts on codepage 1252 [or other pages or unicode) and removing accented characters. The samples below should help with most European languages. Removing accents is a very 'English' thing to want to do, and the resulting names will make less sense to other nationalities! However if you have a large music collection, inconsistently tagged over time, it's much easier afterwards to find all references to an artist.

I'm copy/pasting from a spreadsheet so I can't be sure the text will look correct or not, and you should try copy/pasting from this page back into your package of choice. Although created in WIndows language=En-UK, I think this will work for many of you. I Can't guarantee the code will make sense after posting - I'll check and the post a file if need be.

If you copy multi-line please remove breaks to make one line of text for each command.

For example:




Useful - thanks.

Some others do it too. E.g. SADAIC (Argentina's composers' royalty collection agency) omits all accents from work titles e.g. in its database at .

It is also necessary to make filenames that are sure to survive Windows CMD processing or transfer on FAT32 between Windows OSes having different regional settings.

See also ...
Unicode to Ascii
Unicode to ASCII