HOWTO: Add nls Macintosh Tables to Windows 95 and Windows 98

ID: Q230147


The information in this article applies to:


SUMMARY

Here is an outline of a workaround for the problem of converting between Unicode and Macintosh codepages in Windows 95 and Windows 98, and installing the proper nls table for the Macintosh. Notice that this procedure is necessary for Windows 95 and Windows 98 only, because the nls table comes installed by default with Windows NT.


MORE INFORMATION

Windows 95 and Windows 98 don't ship with Macintosh nls tables or even predefined registry entries for it. The following procedure be adapted to include any nls table.

Because Windows 95 and Windows 98 don't ship with the Macintosh tables, the user must install them by hand if they are needed.

Install the nls table as follows:

  1. Obtain the Macintosh code page from MTS.


  2. Save the nls file (in this case, Cp_10000.nls) into your system directory.


  3. Run regedit and navigate to the following reg key:

    
    \my\computer\HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Nls\Codepage 


  4. Create a new string value and call it 10000.


  5. Add the string "Cp_10000.nls" as its value.


  6. Close regedit and reboot the machine (rebooting may not be necessary).


It is not possible to use the constant CP_MACCP, because it is not defined for Windows 95 and Windows 98; instead, use the actual Macintosh codepage value, which is 10000. For example:

WCHAR   wsz[MAX_PATH];
char    sz[MAX_PATH];
int cwChar = 0;
	
// Convert to Unicode.
strcpy(sz, "This is a Test");
cwChar = MultiByteToWideChar(CP_MACCP, 0, szT, -1, 
					wsz, MAX_PATH); // This fails on Win9x 
cwChar = MultiByteToWideChar(10000, 0, sz, -1, wsz, MAX_PATH);  // This returns a count of 15. 

Additional query words:


Keywords          : 
Version           : WINDOWS:
Platform          : WINDOWS 
Issue type        : kbhowto 

Last Reviewed: August 8, 1999