Software for changing files from Unicode into ASCII

There are some cases when you need to convert Unicode texts into ASCII. I’ve created a small Borland Pascal software for this. See below.

What can you read on this specific blog post?
1. What’s the best use for my software?
2. Alternative: How can you convert Unicode texts into ASCII fast?
3. What does my software do?
4. How to install it?
5. How to use it? (basic)
6. How to change settings? (basic)
7. How to change settings? (advanced)
8. Replacement matrix (what my software replaces)

1. What’s the best use for my software?
I greatly use this software for posting via email on my blogs.

You can also use it before sending emails. Mailing lists will just love your new messages.

2. Alternative: How can you convert Unicode texts into ASCII fast?
First of all, don’t use my software if you want fast conversion.

This can be done quite easily in Notepad (under Windows Operating System). Just create a blank document in Notepad, put the Unicode text in there. Save it. Notepad usually warns you that if you want don’t save as Unicode, you’ll lose some formatting. Hit Ok, then reopen the document. Most Unicode texts are gone. There are still some problems (quotes, for example, are not converted) and for those … I’ve created this blog post.

3. What does my software do?
My software does this trick: it looks for a text file on the desktop, file called a.txt, opens it, looks for some Unicode characters, and replaces them after a pattern. See the end of the file for the default replacement matrix.

4. How to install it?
First, download my software from here:
Software for changing files from Unicode into ASCII.

After download, extract the archive. Place the resulting folder somewhere you won’t move often (Program Files is a good option. Another folder that won’t get removed after Windows reinstallations is even better).

What’s next? The file ‘!Remove diacritics.bat – adapt the text in this file, then use it and put shortcut to it.bat’ can and should be edited. Right click on it and choose “Edit”. You’ll have to update the paths according to the paths on your hard drive. You can then rename the batch file to a shorter name like the simple ‘diacritics.bat’.

Then create a shortcut for the diacritics.bat and put it on the desktop (holding Ctrl + Shift and dragging the batch file to the desktop will do the trick). Move the shortcut where you’ll like it best (quick launch, start menu) or leave it on the desktop. Rename it if you wish, and you can pick another icon from the Properties of the software.

That’s it!

5. How to use it? (basic)
Create a file called a.txt and put it on the desktop and close it. Launch my software via the shortcut. Open the brand new a.txt file. It’s now converted.

6. How to change settings? (basic)
You can edit the replacement matrix yourself. There is a aschars.txt text file with the following structure: a long list of rows. In each row there are two codes: the first one is the character you wish to change, while the second code is the character you wish to change into. You can see the current replacement matrix at the end of this blog post.

Let’s say you wish to edit my matrix. How do you know what are the ASCII codes for the characters? Well, I’ve done an utility especially for that. In the self-explaining “Utility” folder you’ll find a new piece of software. All you have to do is edit a text file (named, again, a.txt). You put in there all the characters whose code you wish to know. You can simply put two chars: a character you wish to change (let’s have for example this one: „), and the resulting character (let’s say is this one: “). My software will then create a text file with the two ASCII codes. Only then you update the replacement matrix and that’s it.

7. How to change settings? (advanced)
If you wish to edit the REMDIAC.PAS software, all you have to do is download the Pascal compile from the Antique Software: Turbo Pascal v5.5 page, extract the archive, install Pascal, and open the Pas file. You can then pick the Compilation destination to disk instead of memory and open my Pas file. Open the .pas file you wish to edit (that’s the source file for the software) and don’t forget to compile it after editing.

What you should note? My software does a little trick. For the “…” character, the program has to put three dots. It has a special procedure for this. If you wish to update the software, just add a new line below this one:
133: Begin c := Chr (46); Write (ies, c); Write (ies, c); End;
The first number represents the Unicode code (133) and the second one is the ASCII code for the dot (46).

Another setting you may wish to change is the default path for Windows. My software assumes there is a ‘C:\windows\system32\cmd.exe’ file, but you may wish to change this.

You can change other things in my software, as you wish.

8. Replacement matrix (what my software replaces)
This is the characters my software replaces and the resulting characters. In the left there is the Unicode character, in the right the corresponding ASCII character:

„  →  “
„  →  “
…  →  ...
“  →  “
”  →  “
•  →  *
–  →  -
«  →  “
·  →  *
»  →  “
  →  A
É  →  E
Π →  I
â  →  a
ã  →  a
é  →  e
î  →  i
ï  →  i
ó  →  o
ô  →  o
ö  →  o
ü  →  u

Some of the chracters are specific for the Romanian language.

I hope you’ll enjoy using my software.

3 Comments

  1. [...] puteti scapa rapid de litere mari si litere mici; eventual foloseste un program realizat de mine: http://getaresultnow.com/software-for-changing-files-from-unicode-into-ascii/ 3. Pune prezentarea pe medii de stocare diferite: in primul rand pe un CD, apoi pe un stick USB [...]

  2. henry says:

    haha ^^ nice, is there a section to follow the RSS feed

Leave a comment (rules to follow)