TextEncoder

Old Batch Text Encoder

Information

On this page you will find a description of the old Batch Text Encoder, which is no longer being developed. We recommend that you use the latest version of the program.

A description of the current version can be found here.

With the Batch Version of the Text Encoder, it is possible to control the Text Encoder via batch script or command line externally.

This makes it possible to remote control the Text Encoder and to start it with recurring settings, configurations, files or parameters. On this page, we would like to introduce you to the functionality with some examples.

First Example: Encode File

We would like to change the encoding of the file C:\text.txt to UTF-8:

TextEncoder.exe C:\text.txt UTF8

As a parameter, we pass the file name and the desired encoding.

To try out this example, you have to go in your command line to the directoy in which the Text Encoder is saved. After that, type in the line like above (beginning from "TextEncoder.exe") and press the enter key.

Pass an arbitrary number of files

You can also process multiple files at the same time. Just use the following command to start the Text Encoder with an arbitrary number of files (here "C:\Dat1.txt" and "C:\Dat2.txt").

TextEncoder.exe C:\Conf.tkg C:\Dat1.txt C:\Dat2.txt

If you try this command, the Text Encoder will convert all files to the format UTF-8. When passing files in this way, it plays no role whether you are passing one or more files.

Change Byte Order Mark

You can specify whether a Byte Order Mark (BOM) should be written into the files:

TextEncoder.exe C:\dat1.txt UTF8 bom=0
TextEncoder.exe C:\dat1.txt UTF8 bom=1
TextEncoder.exe C:\dat1.txt UTF8

With the parameter "bom", you can specify, whether a Byte Order Mark (BOM) should be written into the files. "bom=0" says, that no BOM should be written, "bom=1" makes sure that a BOM will be written. If you do not specify this paramer (line 3), the BOM will be written per default into the files.

Pass a full directory and convert the containg files

Next to passing individual files, you can also pass one ore more complete folders:

TextEncoder.exe C:\Dir1 C:\Dir2 UTF8

In this example, we are passing the directories "C:\Dir1" and "C:\Dir2" and we would like to convert their contents into the UTF-8 format. When doing so, only text files from the directories are converted and also sub directories are searched for files.

List of Parameters

Here you can see a list of all parameters, you can use in the Batch Version.

Parameter Meaning
[File Name] Specify the name (and optionally the path) of a file to process it.
[Directory] Specify a folder, to process all text files from this folder.
ANSIFile(s) will be converted to ANSI.
UTF7File(s) will be converted to UTF-7.
UTF7ANSIFile(s) will be converted to UTF-7 ANSI.
UTF16LEFile(s) will be converted to UTF-16 Little Endian.
UTF16BEFile(s) will be converted to UTF-16 Big Endian.
UTF32LEFile(s) will be converted to UTF-32 Little Endian.
UTF32BEFile(s) will be converted to UTF-32 Big Endian.
bom=1 The Byte Order Mark (BOM) will be written into the file. If you leave the BOM-parameter, this is the default.
bom=0 The Byte Order Mark (BOM) will not be written into the file.
log=1 If the log-parameter is commited, the Text Encoder logs events like errors during processing and file editings in the file process.log.

All parameters and file names can be commited in any order. Likewise, it is possible to add several files at the same time with adding each file by using a particular parameter for it.

The functionality of the Text Encoder is expanded from time to time. If you should have suggestions for more parameters, let us now.

Example for a Batch Script

Last, we would like to show you a small example of a batch script. Copy the following text (of course you can also adjust the text to your file names) to a normal plain text file and rename the file to "batchsript.bat". The file should be saved in the same directory like the Text Encoder.

start /wait TextEncoder.exe C:\F1.txt UTF8 bom=0
start /wait TextEncoder.exe C:\F2.txt ANSI
start /wait TextEncoder.exe C:\Folder UTF16LE
@echo off

If you double click on the file (the file extension *.bat is important), first the Text Encoder will convert the file F1.txt to UTF-8 without BOM and after that, the file F2.txt will be converted to ANSI. Finally, all files from the directory "C:\Folder" are converted to UTF-16 Little Endian including BOM.

The "start /wait" causes, that the next line will be executed after the first line is finished. That means, as soon as the Text Encoder is closed after the automatic processing of file "F1.txt", the second line will be executed and the file "F2.txt" will be processed. The last line (@echo off) means that the command line is closed after the batch script is executed.

Order Text Encoder Batch

The Text Encoder Batch costs 49 USD (39 Euro). Information about how to order, you can see on our download page. If you have further questions, feel free to contact us. If you should already have orderd a normal Standard Text Encoder licence, you can upgrade your licence, so that you only pay the difference.