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.
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
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.
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:
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))