Although FAR respects Unicode files it was written in the 1990's and is essentially an ANSI application. When FAR reads information from a Unicode file it must temporarily convert it into ANSI using the current Windows Code Page.
When the Windows Code Page (language) is not set correctly (eg. Windows is setup for English and FAR is asked to search a Greek Unicode file for text) then FAR will display the "Invalid Code Page dialog". The windows Unicode to ANSI function has just told FAR there is a character it can not convert to ANSI using the current Code Page.
See How to set the Windows Code Page (Language).
FAR displays the name of the problem file, and prompts you to choose a more appropriate ANSI Code Page. Select one of the ANSI Code Pages listed at the top of the dropdown list. The non-ANSI items lower down should normally be ignored.
The Invalid Code Page dialog allows you to either:
- Retry the operation after selecting a more appropriate ANSI Code Page (language) that matches the problem file.
- Skip the problem file and move on. If FAR is working with only one file then this is the same as Cancel.
- Cancel all current operations.
23-Jan-2007: The dialog now allows you to choose the Code Page via a second dropdown list. The language dropdown list is bound to the first Code Page dropdown list. I.E. When you select a language it automatically chooses the correct Code Page for you in the first list.
FAR remembers any Code Page your try that successfully encodes to ANSI. Next time you convert to ANSI, FAR automatically tries to use the Code Page again. FAR keeps its "good Code Page list" until either you restart FAR or you open the Set File Encoding dialog.
Note: It's reasonable when searching for plain English text to select the UTF-8 code page (65001). Even if the file being read is already UTF-8 or is UTF-16. By working in UTF-8 FAR can simple match the single byte ANSI English text (it is unlikely to match the multi-byte non-English characters).
Note: If you have a Unicode file containing more than 2 non-English languages then you may have problems since FAR reads each file using a single Code Page. Again if you are searching for English text then try working in the UTF-8 (65001) Code Page.
See Also: Learn About Unicode
In HH 1.x (makes .chm help files) project and content files must be ANSI file type. HH 1.x does not support Unicode encoded files. See also web link: Unicode Support in HH
MS Help 2.x (Help system for MS Visual Studio 7 and MSDN) fully supports both ANSI and Unicode. When you create a new Help Project with MS Help 2.x SDK or FAR H2, you are prompted for the file encoding type to work in - ANSI or Unicode (UTF-16 or UTF-8). You would generally select ANSI, if working with a simple single-byte language such as English. Umlauts characters will often cause compiler errors so try UTF-8 encoding for the project files and/or topic files.
If you are working with Unicode files then you should be using Windows 2000 or XP which fully supports Unicode. If you are using mixed languages in your help you should be using Unicode files.
|
|
Note: Some HTML and Text Editors such as Macromedia HomeSite may only support ANSI file editing. Most MS Editors (FrontPage, NotePad, WordPad) fully support Unicode file editing under Win 2K/XP. |
For more information on Unicode please read the Help 2 VSHIK online-help or search google.com
This version of the FAR application is Ansi based. It likes to perform most string manipulation in ANSI although it respects Unicode files and will handle them correctly if the Code Page (Windows language) is set correctly. The Windows Code Pages allows Windows to map Unicode (1000s of chars) strings correctly to/from ANSI (256 chars) strings. But only one language at a time since each Code Page handles English + one other language. See description of Code Page & Ansi below.
For example let's say you need to perform file encoding changes (Commands > Set File Encoding) as well as some Find and Replace on some Unicode files. Both these file commands require FAR to convert between Unicode and ANSI.
English files are no problem because all Code Pages contain the English character set. If we are working with Japanese Unicode files we better make sure we are on a Japanese machine so that the Code Page/Language support will be Japanese, OR work under Win 2000/XP/2003 with Japanese support enabled.
When working with say Japanese text on non-Japanese windows you must set the Windows language/Code Page to Japanese. This will do 3 things:
- Enable FAR to respect ANSI Double Byte characters (English ANSI strings are all single byte while Japanese strings have a mixture of single and double bytes).
- Enable FAR to display Japanese characters on most dialogs (Under true Japanese Windows all dialogs can display Japanese text. Under English Windows FAR may not always be able to display Japanese text).
- Enable FAR to correctly convert between ANSI and Unicode Encoding.
- Enable FAR to except foreign language text input.
If you do try to work with a Japanese Unicode file with the wrong Code Page, you will receive an error telling you that Windows could not convert the text using the current code page. In this case make sure your Windows language is the same as the language as the Unicode file. If you have to work on both Japanese and Chinese files then make sure the Windows language is set to Japanese for the Japanese files and then change over to Chinese for the Chinese files (ie. one language at a time).
As noted above (Invalid Code Page dialog) FAR can work with more than one non-English language if you are careful.
To set the System default language on Windows 2000:
- Control Panel->Regional and Language Options.
- At the bottom, where you can check the different languages to support, click on Set Default...
- Select say "Japanese" from the list.
- Reboot.
To set the System default language on Windows XP:
- Control Panel->Regional and Language Options.
- On the Advanced page select the "Language for Non-Unicode programs" to say "Japanese".
- Make sure the required Code Page is installed (checked in the Code Page list).
- For Chinese, Japanese, and Korean languages check the box "Install Files for East Asian languages" on the Languages page tab.
- Reboot.
To set the System default language on Windows Vista:
- Control Panel->Regional and Language Options.
- On the Administrative page click the "Change System Locale" button and select the required locale.
Note: Only Windows 2000/XP/2003/Vista fully supports Unicode. Newer operating systems have better support. Windows Home version may contain all available languages.