Microsoft Layer for Unicode

Microsoft Layer for Unicode

Microsoft Layer for Unicode (or MSLU) is a software library for Windows software developers to simplify creating Unicode-aware applications for Windows 95, Windows 98, or Windows Me. It is also known as UnicoWS (Unicode for Windows 95/98/Me Systems) or UNICOWS.DLL, or even "cows".

Microsoft describes it as providing "a layer over the Win32 API on Windows 95/98/ME so that you can write a single Unicode version of your application and have it run properly on all platforms."[1] Previously, software developers had to either provide two separate versions of an application, or perform complex string translations and API decisions at runtime.

Contents

Availability

The MSLU was announced in March 2001, and first available in the July 2001 edition of Microsoft's Platform SDK, which is arguably long after the peak popularity of Windows 95/98/ME.

It had a codename of Godot, which is a reference to the play Waiting for Godot (centered around the failure of a man named "Godot" to appear and the endless wait for him), because it was felt to be long overdue.[2]

How it works

Normally, the Windows API provides both A (ANSI) and W (Wide-character) versions of most functions. On Windows 95/98/ME, only the A versions are implemented and attempting to call a W version will fail with an error code that indicates that function is unimplemented. On Windows NT/2000/XP/2003, both the A and W versions are implemented (however the operating system generally only internally implements the W version natively, and the A version is usually a translation thunk to the W version).

By adding the UNICOWS.LIB to the link command-line before KERNEL32.LIB, ADVAPI32.LIB, or any other supported Win32 system link library, the linker will resolve referenced symbols with the one provided by UNICOWS.LIB instead.

When a wide-character function is called for the first time at runtime, the function stub in UNICOWS.LIB first receives control and decides if it is running on a Windows 95/98/ME system:

  • If so, it dynamically loads the UNICOWS.DLL (if it hasn't been loaded yet) and passes control to the corresponding thunking stub in there. The thunking stub translates the wide-character arguments into ANSI strings and then invokes the native A version from the OS, and then translates any returned strings back into wide-character format.
  • If the OS natively supports the W version (i.e. Windows NT/2000/XP/2003), then the function stub updates the in-memory import table so that future calls will directly invoke the native W version without any more overhead.

Because of this technique, when an application is linked against MSLU, only Windows 95/98/ME systems will need the UNICOWS.DLL at runtime, and on all other operating systems there is only a slight performance penalty for the first function call.

A common problem encountered occurs when some updaters and uninstallers rename or delete the file oledlg.dll, preventing the operating system from loading unicows.dll. This results in applications, such as OpenOffice.org, reporting that "Application cannot start because one of the required libraries cannot be found." This occurs even if unicows.dll is installed in the system.

References

  1. ^ http://www.microsoft.com/globaldev/handson/dev/mslu_announce.mspx
  2. ^ http://weblogs.asp.net/michkap/archive/2005/02/12/371650.aspx

External links

Microsoft

Open source alternatives

  • libunicows — provides an MIT-licensed version of only the UNICOWS.LIB link-library, but still requires the Microsoft-provided UNICOWS.DLL or the Mozilla OPENCOW.DLL.
  • opencow (previously MZLU) — reimplements both the DLL and LIB link-library as MPL 1.1/GPL 2.0/LGPL 2.1, originally for the Mozilla project.

Wikimedia Foundation. 2010.

Игры ⚽ Нужна курсовая?

Look at other dictionaries:

  • Microsoft Layer for Unicode — (MSLU) est une bibliothèque logicielle destinée à simplifier le développement de logiciels reconnaissant Unicode et tournant sous Windows 95, Windows 98 ou Windows Me. Elle est aussi connue en tant que UnicoWS (Unicode for Windows 95/98/Me… …   Wikipédia en Français

  • Unicode — For the 1889 Universal Telegraphic Phrase book, see Commercial code (communications). The Unicode official logo since October 2009 …   Wikipedia

  • List of Microsoft codenames — Microsoft codenames are the codenames given by Microsoft to products it has in development, before these products are given the names by which they appear on store shelves. Many of these products (new versions of Windows in particular) are of… …   Wikipedia

  • Юникод в операционных системах Microsoft — Одной из первых компаний, последовательно внедрявших Юникод, была Майкрософт  Windows NT была первой операционной системой, использовавшей Юникод в системных вызовах. Было выбрано двухбайтное представление символов (UCS 2); начиная с Windows …   Википедия

  • Юникод в Microsoft Windows — Одной из первых компаний, последовательно внедрявших Юникод, была Майкрософт  Windows NT была первой операционной системой, использовавшей Юникод в системных вызовах. Было выбрано двухбайтное представление символов (UCS 2); начиная с Windows 2000 …   Википедия

  • Юникод в операционных системах семейства Microsoft Windows — В этой статье отсутствует вступление. Пожалуйста, допишите вводную секцию, кратко раскрывающую тему статьи …   Википедия

  • Microsoft Office — Developer(s) Microsoft Initial release November 19, 1990; 21 years ago ( …   Wikipedia

  • Microsoft Dynamics AX — 2009 (Multisite example) Developer …   Wikipedia

  • Кодовые имена ПО Microsoft — Содержание 1 Windows 3.1x/9x 2 Семейство Windows NT 3 Windows CE family 4 Семейство DirectX …   Википедия

  • Microsoft RPC — (Microsoft Remote Procedure Call) is a modified version of DCE/RPC. Additions include support for Unicode strings, implicit handles, inheritance of interfaces (which are extensively used in DCOM), and complex calculations in the variable length… …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”