# Unicode to ASCII

**URL:** https://community.mp3tag.de/t/unicode-to-ascii/7279
**Category:** General Discussion
**Tags:** howto
**Created:** [October 3, 2008, 1:00pm UTC](https://community.mp3tag.de/t/unicode-to-ascii/7279 "2008-10-03T13:00:53Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![DetlevD](https://community.mp3tag.de/user_avatar/community.mp3tag.de/detlevd/32/123_2.png) [@DetlevD](https://community.mp3tag.de/u/DetlevD)
#### Post date: [October 3, 2008, 1:00pm UTC](https://community.mp3tag.de/t/unicode-to-ascii/7279/1 "2008-10-03T13:00:53Z")

</div>

I have created six actionsgroups for the purpose of transcoding UTF-8 Unicode characters into 7-bit ASCII characters (see attached MTA files).

Each group of actions encloses a special set of Unicode characters, so that you are free to combine what replacement presentation you need.

The transcoding scheme is derived from the script 'uni2ascii.c', version 2008-08-30T20:27:37, by William J. Poser (billposer@alum.mit.edu), including some small changes by me.

I do not know if the MTA files will do their work error free in all cases, this task to check it out is to you.

[UniToAsc.Diacritics.mta](https://community.mp3tag.de/uploads/default/original/1X/7ea91557d2856aaeddc293f8ebfac0dfd3befdef.mta) (8.64 KB)  
[UniToAsc.Enclosed.mta](https://community.mp3tag.de/uploads/default/original/1X/b018c9a5093053655b99c5e06cc12dc878de3f2c.mta) (3.52 KB)  
[UniToAsc.Equiv.mta](https://community.mp3tag.de/uploads/default/original/1X/8aa98dd15701ab733e1da8f24f33e10f586e22bf.mta) (1.22 KB)  
[UniToAsc.Expand.mta](https://community.mp3tag.de/uploads/default/original/1X/83bbb47b1f09f7cc2a4feabbb93349fa3a1be6db.mta) (2.21 KB)  
[UniToAsc.Style.mta](https://community.mp3tag.de/uploads/default/original/1X/e2ec78491982a2ecd749bb1302d502cdb356a58f.mta) (12.5 KB)  
[UniToAsc.Symbols.mta](https://community.mp3tag.de/uploads/default/original/1X/5aa9525c41b2550cd5899229a259d57caee45edd.mta) (1.53 KB)  
[20090807.Transcoding\_scheme\_from\_Unicode\_to\_ASCII.pdf.zip](https://community.mp3tag.de/uploads/default/original/1X/1c84aad615d16823579f89dffa9fefebd16fcef6.zip) (153 KB)  
If there is some quirk in the transcoding scheme or if you have found out a neater transcoding scheme or if something otherwise is missing, then feel free to come back and report.

DD.20081003.1700.CEST  
Fixed some few quirks.  
Added rtf document for quick overview of character replacements.  
DD.20081005.2237.CEST  
Changed rtf document for quick overview of character replacements.  
DD.20081008.1317.CEST  
Changed rtf document to zipped pdf document.  
DD.20081008.1557.CEST  
Changed one error regarding character "a" in UniToAsc.Style.mta and related pdf document.  
History:  
UniToAsc.Style.mta ( 12.45K ) Number of downloads: 35  
Transcoding\_scheme\_from\_Unicode\_to\_ASCII.pdf.zip ( 151.59K ) Number of downloads: 139

[UniToAsc.Diacritics.mta](https://community.mp3tag.de/uploads/default/original/1X/7ea91557d2856aaeddc293f8ebfac0dfd3befdef.mta) (8.64 KB)

[UniToAsc.Enclosed.mta](https://community.mp3tag.de/uploads/default/original/1X/b018c9a5093053655b99c5e06cc12dc878de3f2c.mta) (3.52 KB)

[UniToAsc.Equiv.mta](https://community.mp3tag.de/uploads/default/original/1X/8aa98dd15701ab733e1da8f24f33e10f586e22bf.mta) (1.22 KB)

[UniToAsc.Expand.mta](https://community.mp3tag.de/uploads/default/original/1X/83bbb47b1f09f7cc2a4feabbb93349fa3a1be6db.mta) (2.21 KB)

[UniToAsc.Symbols.mta](https://community.mp3tag.de/uploads/default/original/1X/5aa9525c41b2550cd5899229a259d57caee45edd.mta) (1.53 KB)

[UniToAsc.Style.mta](https://community.mp3tag.de/uploads/default/original/1X/e2ec78491982a2ecd749bb1302d502cdb356a58f.mta) (12.5 KB)

[20090807.Transcoding\_scheme\_from\_Unicode\_to\_ASCII.pdf.zip](https://community.mp3tag.de/uploads/default/original/1X/1c84aad615d16823579f89dffa9fefebd16fcef6.zip) (153 KB)

---

<div class="post-metadata">

### Author: ![Stevest](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/a698b9/32.png) [@Stevest](https://community.mp3tag.de/u/Stevest)
#### Post date: [October 3, 2008, 6:23pm UTC](https://community.mp3tag.de/t/unicode-to-ascii/7279/2 "2008-10-03T18:23:22Z")

</div>

Thank you very much. Great job.

---

<div class="post-metadata">

### Author: ![DetlevD](https://community.mp3tag.de/user_avatar/community.mp3tag.de/detlevd/32/123_2.png) [@DetlevD](https://community.mp3tag.de/u/DetlevD)
#### Post date: [October 5, 2008, 6:44pm UTC](https://community.mp3tag.de/t/unicode-to-ascii/7279/3 "2008-10-05T18:44:56Z")

</div>

Thank you, Stevest.

See updated post #1 at top of the thread.

DD.20081005.2245.CEST

---

<div class="post-metadata">

### Author: ![Stevest](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/a698b9/32.png) [@Stevest](https://community.mp3tag.de/u/Stevest)
#### Post date: [October 6, 2008, 1:50am UTC](https://community.mp3tag.de/t/unicode-to-ascii/7279/4 "2008-10-06T01:50:42Z")

</div>

Thank you again, you made my life easier. The new included rtf is very very useful to see the differences between the scripts.

---

<div class="post-metadata">

### Author: ![DetlevD](https://community.mp3tag.de/user_avatar/community.mp3tag.de/detlevd/32/123_2.png) [@DetlevD](https://community.mp3tag.de/u/DetlevD)
#### Post date: [October 8, 2008, 12:04pm UTC](https://community.mp3tag.de/t/unicode-to-ascii/7279/5 "2008-10-08T12:04:44Z")

</div>

> [@Stevest](#):
>
> ... Thank you again, you made my life easier. The new included rtf is very very useful to see the differences between the scripts.

The transcoding overview now uses a proper unicode font and has been changed from rtf document to a zipped pdf document.

DD.20081008.1604.CEST

---

<div class="post-metadata">

### Author: ![Patch](https://community.mp3tag.de/user_avatar/community.mp3tag.de/patch/32/9350_2.png) [@Patch](https://community.mp3tag.de/u/Patch)
#### Post date: [June 2, 2019, 8:02pm UTC](https://community.mp3tag.de/t/unicode-to-ascii/7279/6 "2019-06-02T20:02:49Z")

</div>

Just downloaded and tried (diacritics) this. Seems it doesn't work?

---

<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: [June 2, 2019, 8:28pm UTC](https://community.mp3tag.de/t/unicode-to-ascii/7279/7 "2019-06-02T20:28:02Z")

</div>

Could you specify what does not work?  
Have you filled the field uni\_to\_asc?

---

<div class="post-metadata">

### Author: ![Patch](https://community.mp3tag.de/user_avatar/community.mp3tag.de/patch/32/9350_2.png) [@Patch](https://community.mp3tag.de/u/Patch)
#### Post date: [June 2, 2019, 8:44pm UTC](https://community.mp3tag.de/t/unicode-to-ascii/7279/8 "2019-06-02T20:44:29Z")

</div>

I’ve imported the .mta file into my actions folder, then triggered the action.

It runs but doesn’t do anything.

---

<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: [June 3, 2019, 5:11am UTC](https://community.mp3tag.de/t/unicode-to-ascii/7279/9 "2019-06-03T05:11:10Z")

</div>

> [@Patch](#):
>
> It runs but doesn’t do anything.

This does not anwer the question

> [@ohrenkino](#):
>
> Have you filled the field uni\_to\_asc?

What would you expect should happen?  
It would be worthwhile to have a look at the action and see what it does - and then adapt it according to your needs or adapt your proceedings to the action.  
In this case: the action treats a field called uni\_to\_asc. Either you fill it or you rename the field in the action.

---

<div class="post-metadata">

### Author: ![Patch](https://community.mp3tag.de/user_avatar/community.mp3tag.de/patch/32/9350_2.png) [@Patch](https://community.mp3tag.de/u/Patch)
#### Post date: [June 3, 2019, 6:33am UTC](https://community.mp3tag.de/t/unicode-to-ascii/7279/10 "2019-06-03T06:33:57Z")

</div>

Thanks - I understand now. I’ll change the field that the action gets applied to to %\_filename% and try that.

---

<div class="post-metadata">

### Author: ![Patch](https://community.mp3tag.de/user_avatar/community.mp3tag.de/patch/32/9350_2.png) [@Patch](https://community.mp3tag.de/u/Patch)
#### Post date: [June 3, 2019, 7:30pm UTC](https://community.mp3tag.de/t/unicode-to-ascii/7279/11 "2019-06-03T19:30:49Z")

</div>

All good.

Works perfectly!

---

<div class="post-metadata">

### Author: ![honzab32](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/h/3da27b/32.png) [@honzab32](https://community.mp3tag.de/u/honzab32)
#### Post date: [October 30, 2019, 7:46pm UTC](https://community.mp3tag.de/t/unicode-to-ascii/7279/12 "2019-10-30T19:46:39Z")

</div>

[UniToAsc2.Style.mta](https://community.mp3tag.de/uploads/short-url/lI2VDCTlNWLZojBYORZxJ3M1lbt.mta) (19.3 KB)

Hi,  
when I executed the action UniToAsc.Style, it stopped with a plenty of errors. When I took a look in the file UniToAsc.Style.mta, I spotted that some replaced characters are written like the encoding used should be UTF-32. I think it was the reason of these errors. I made my own action that should do the same for UTF-16 encoding. I made a program in python that created this action using the UniToAsc.Style.mta file. For those who are interested, its source code is:

```auto
cislo=int("1d400",16)-int("dc00",16)
with open("c:\\Users\\honza\\AppData\\Roaming\\Mp3tag\\data\\actions\\UniToAsc.Style.mta","r",encoding="ascii") as ss:
    radky=ss.readlines()
    radky=radky[:249]+[radky[249][:2]+"(?#E)"+radky[249][2:]]+radky[250:]
    i=225
    while (i<len(radky)):
        kody=list()
        z=16
        while (radky[i][z]=="}"):
            z=z+9
        pr=z-4
        while (pr<len(radky[i])):
            kody.append("(\\\\x{D835}\\\\x{"+hex(int(radky[i][pr:pr+5],16)-cislo)[2:].upper()+"})")
            pr=pr+10
        radky[i]=radky[i][:z-8]+"]"+"|"+"|".join(kody)+"\n"
        i=i+6

with open("c:\\Users\\honza\\AppData\\Roaming\\Mp3tag\\data\\actions\\UniToAsc2.Style.mta","w",encoding="ascii") as ns:
    ns.write("".join(radky))

```

---

<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 10, 2021, 5:16pm UTC](https://community.mp3tag.de/t/unicode-to-ascii/7279/13 "2021-02-10T17:16:46Z")

</div>

A post was split to a new topic: [Replace diacritics within folder names](https://community.mp3tag.de/t/replace-diacritics-within-folder-names/51937)
