How to properly set up Win95/98/Me for KOI8-R
ATTENTION: A perfect solution for Win95/98/Me would be using KOI8-R<->CP1251 translation tables at the system level or inside each Internet or HTML related program (even this solution have some disadvantages, but nothing more fancy can be done in Win95/98/Me at this moment). Until this is implemented (I guess, after some critical mass of decoding programs is reached), a temporary solution is available here.
It is commendable that some programs support KOI8-R<->CP1251 translation automatically, but:
- Such programs are relatively rare (for example, Mozilla 1.7.3 , Opera 12 , MS Internet Explorer and MS Outlook Express Mail/News do it), a lot of interesting Internet software is unaware about the necessary decoding.
- Emulating KOI8-R via CP1251 can't be complete because character repertoires are different. Properly done, this would require UNICODE intermediation.
See also Notes on the Cp_20866.nls resource (for programmers).
As a matter of fact, we don't need KOI8-R fonts at all,
as .TTF fonts from Microsoft are always in
UNICODE
,
and we only need to make use of them.
The only thing to do is to add KOI8-R -> UNICODE translation
table as a resource to
\Windows\System\gdi.exe.
This resource is a simple array with 256
entries of word size: index is the ANSI code of character,
value is the Unicode code.
It is RC_DATA with ID=100..200,
its name is stored in the
corresponding string resource 1000+ID.
Step-by-step instructions for creating the KOI8-R translation resource
-
Choose one of
already patched files:
-
Windows Me (Russian Edition):
gdi.exe, Zip
(version 4.90.0.3000) -
Windows Me (Standard):
gdi.exe, Zip
(version 4.90.0.3000) -
Win98 SE (Second Edition), American or PanEuropean:
gdi.exe, Zip
(version 4.10.2222) -
Win98 SE (Second Edition), Russian:
gdi.exe, Zip
(version 4.10.2222) -
Win98 Standard (American) or PanEuropean:
gdi.exe, Zip
(version 4.10.1998) -
Win98 Russian:
gdi.exe, Zip
(version 4.10.1998) -
Win95 Standard:
gdi.exe, Zip
(your originalgdi.exesize must be 312,208 bytes) -
Win95 Russian:
gdi.exe, Zip (it works with OSR2 too)
(your originalgdi.exemust be 312,496 bytes) -
Win95 PanEuropean:
gdi.exe, Zip
(your originalgdi.exemust be 312,464 bytes) -
Win95 German:
gdi.exe, Zip
(your originalgdi.exemust be 312,336 bytes)
-
Windows Me (Russian Edition):
-
If your system's
gdi.exesize or type don't match any of the above, you need to patch yourgdi.exeyourself using instructions from step 5 onwards. If you've got a successful result, please send me your patchedgdi.exezipped copy and I'll add it to those listed above. -
Reload Win95/98/Me in "command prompt only" (plain MS-DOS) mode,
backup your old
\Windows\System\gdi.exeand move the unpackedgdi.exefrom temporary directory to\Windows\System\(you can't just overwritegdi.exefrom inside Win95/98/Me because the file is in use or protected with PCHealth).WARNING: for WinMe you need to boot from Startup Diskette to get the "command line" prompt!
- Reboot the system again in Win95/98/Me mode and jump to step 10.
-
Make a copy of your
\Windows\System\gdi.exeand open this copy in Visual C++ 4.0 or Borland Resource Workshop 4.5. -
Choose
the
IDvalue238 (Central European). Using this particularIDallows KOI8-R fonts to appear as Central European fonts (font names withCEsuffix will be later changed toFont Name KOI8-R) for older programs such asCharacter MaporMicrosoft Word 6.0. - Overwrite this resource with the resource data below: (it conforms to Unicode translation table as per RFC 1489)
-
Each Data ID has a corresponding string in the string table with
ID + 1000(forCentral Europeanit's1238). That's what is shown in programs' font selection boxes, usually under the title of Script for Win95/98/Me Standard Edition or Набор символов for Win95 Russian Edition. Change the string toRussian (KOI8-R)for Win95/98/Me Standard Edition or toРусский (KOI8-R)for Win95 Russian Edition. You can download Borland Resource Workshop data (Script name) for Win95/98/Me Standard Edition or Borland Resource Workshop data (Набор символов name) for Win95/98/Me Russian Edition and paste it into the1238resource. -
Save, backup your
\Windows\System\gdi.exe, restart the system in command prompt mode (this step is important), rename just saved copy to\Windows\System\gdi.exeand reboot your PC back to Win95/98/Me. -
Open
\Windows\win.ini, find[FontSubstitutes]
section (or add one, if it's not present). Check allCEsuffixes, this entries should look like:Arial CE,238=Arial,238 Arial CE,0=Arial,238 Courier New CE,238=Courier New,238 Courier New CE,0=Courier New,238 Times New Roman CE,238=Times New Roman,238 Times New Roman CE,0=Times New Roman,238 Arial Black CE,238=Arial Black,238 Arial Black CE,0=Arial Black,238 Impact CE,238=Impact,238 Impact CE,0=Impact,238 Verdana CE,238=Verdana,238 Verdana CE,0=Verdana,238 Lucida Sans Unicode CE,238=Lucida Sans Unicode,238 Lucida Sans Unicode CE,0=Lucida Sans Unicode,238 Haettenschweiler CE,238=Haettenschweiler,238 Haettenschweiler CE,0=Haettenschweiler,238
(not all of them may be present in your case).This provides access to KOI8-R fonts for old (Win3) programs that are unaware about font Scripts. Now you should remember that the
CEsuffix in the font list points to a KOI8-R font. E.g., choosingTimes New Roman CEin WinWord will allow you to work with KOI8-R texts.WARNING for programmers: don't change
CEsuffix to something more appropriate (such asKOI8-R), some programs (e.g. WinWord) check if this suffix belongs to the list of known suffixes, soCEmust remain in place as a provision for such (rare) cases. - Save the file and reboot.
-
Now launch any program with a font selection box, you'll
find a
Russian (KOI8-R)Script there, select it and enjoy. - It's time now to set up the native Win95/98/Me keyboard driver for KOI8-R.
Great help on these matters was provided by Walter Kondrashov <Walt@gecko.crec.mipt.ru>, Alexander Smundak <sasha@whitelight.com>, and Vadim Burtyansky <burtyan@luckynet.co.il>, thanks.
See also the same issue for Win3.11, the same issue for WinNT, Notes on the Cp_20866.nls resource (for programmers), and How to set up the native Win95/98/Me keyboard driver for KOI8-R.