Subject: 2. Specifying an encoding when saving a file
Author:
Authors
[
Next Thread |
Previous Thread |
Next Message |
Previous Message
]
Date Posted:17:56:23 07/08/04 Thu In reply to:
Mahmud Kashgari
's message, "Re: 2. Writing in Arabic in VTrain 4.5" on 05:56:07 07/05/04 Mon
>I find it odd that all the time, you talk about fonts,
>but encoding is not directly tied to the fonts. In the
>Internet Explorer, I can change the encoding of an
>html file to whatever I like. I can make it UTF-8, ISO
>8859-x, or Windows-1252. Obviously, the page will
>display correctly when the encoding I select matches
>the page's original encoding. For other encodings, I
>get garbage, but I still get something displayed, <em>
>using the same font all over </em>. So, fonts are not
>the real problem, as long as they contain the
>necessary glyphs. The problem is in encoding.
Please notice that browsers do not work the same way as text editors or VTrain, for example.
Actually, HTML pages are nothing but plain text files (<b>".txt"</B>) with a 'fake' extension (.htm). For backward compatibility, the 'source code' of an HTML page is usually written in ANSI (Western), and a header in that code tells the browser which encoding scheme it must use to display the page. Just open an HTML page with Notepad to see something like this:
<blockquote><META HTTP-EQUIV="Content-Type" CONTENT="text/html;CHARSET=iso-8859-1"></blockquote>
This is a simple and elegant approach, but since this header is set once for the whole page, multilingual documents are not possible, unless you use the <u>Text only (Unicode)</u> format.
For this reason, most editors use the rich text format <b>".rtf"</b> instead of ".txt", which stores information about encodings along with font data. This is the case of Microsoft Word and VTrain, but since VTrain 4.5 is not Unicode-enabled yet, non-Western glyphs get lost when you save Decks of flashcards (".vok" files), and when you <b>export</b> a ".vok" Deck to a ".txt" file with VTrain 4.5, it is saved as Text only (ANSI).