Set File Encoding Dialog

The Set File Encoding dialog is available from the Commands menu in the main window. It allows you to change a file's file type to Unicode or ANSI.

This command has the same effect as opening a file in Notepad (under windows 2000 or XP) and changing the Encoding via the SaveAs dialog. Except FAR allows you to convert foreign language files using the Code Page select dropdown.

Note: In the FAR main window the selected file's encoding is displayed in the status line under the FAR file list.

Encoding

Choose the type of file encoding you want to change your files to.
For more information see Unicode Support in FAR.

Code Page - Select an ANSI Code Page to use

Ignore this setting if your files are all the same language as your operating system.

Use the Code Page dropdown to change the Code Page (language) used to convert the files. If you are converting say Japanese files on an English Windows PC you must select ANSI Japanese Code Page. Choose one of the ANSI Code Pages from the top of the dropdown list (the other items are there just to offer a complete list of code pages).

As authors we would normally work with one language at a time. The language (Code Page) is set in the Windows "Control Panel > Regional and Language Options" dialog (Win 2000 & Win XP) . This system Code Page is selected in the Code Page dropdown list when you open this dialog.

If you do work with a language different than from the system language, then be very careful to select the appropriate ANSI Code Page when converting to or from the ANSI file type. Otherwise non-English characters will be converted incorrectly. Remember however that all Code Pages contain the English character set.

When converting from Unicode (any type) to Unicode (any type) the Code Page dropdown setting is ignored.

Source file encoding detection method

Select an "Encoding Detection Method" if you want to convert Unicode files that do not have a Unicode file signature.

Normally Unicode files are recognized by their Byte-Order Mark file signature. For UTF-16 this is a leading 2 byte signature. For UTF-8 this is a leading 3 byte signature. ANSI files don't have a BOM signature.

Some applications such as XMetal create Unicode files without BOM signatures. Programs such as Windows NotePad correctly recognize these files because they examine the file content and make a guess. FAR does not do this. If you are unsure of a files encoding type, open the file in NotePad and read the encoding type from the File > Save As dialog.

To convert files that don't have a BOM signature you need to tell FAR the encoding of the source files.

Invalid Code Page dialog

Windows can not protect you from using the wrong code page when converting from ANSI (narrow) to Unicode (wide). However going from Unicode (wide) to ANSI (narrow) Windows will flag an error if the chars cannot be converted under the selected Code Page. In this case FAR will display the Invalid Code Page dialog and allow you to select a more appropriate ANSI Code Page.

Range

Select All Files to change the encoding of all files in the FAR file list. Select Selected Files to change only the selected files. The later will be disabled if no files are selected.

Results

If a target file is already at the desired Encoding type then no action is performed on that file.

On completion, files modified will show Matches = 1 in the FAR file list. Files not modified (already at the requested encoding) will show Matches = 0. Files that could not be changed (file accessed error or invalid Code Page error) will show Matches = empty (no text display).


http://www.helpware.net/