Tcl Source Code

View Ticket
Login
Ticket UUID: 2819611
Title: Use Microsoft Layer for Unicode for win95/98/ME support
Type: RFE Version: None
Submitter: nijtmans Created on: 2009-07-10 13:45:20
Subsystem: 52. Portability Support Assigned To: patthoyts
Priority: 5 Medium Severity:
Status: Closed Last Modified: 2010-08-14 23:49:12
Resolution: Wont Fix Closed By: nijtmans
    Closed on: 2010-08-14 16:49:12
Description:
As of now, Tcl uses its own solution to maintain a single
binary which works on all Windows versions, and still
be fully unicode-aware if the platform is >=Win-NT
However, recently, Microsoft developed MSLU,
which provides a 'standard' solution for the same
problem. See:
    <http://msdn.microsoft.com/en-us/goglobal/bb688166.aspx>

Using this, would have prevented bugs like #2806622, and
would free the Tcl developers from maintaining our own
solution: the whole current machinery can simply be
removed, and everything compiled in unicode-mode, and
still it will work on Win95/98/ME.

I can only see one disadvantage: starpacks will stop
functioning on Win95/98/ME (unless Unicows.dll is
available on the system somewhere). Apart from
that, I only see advantages. We still can continue
to support Win95/98/ME, by only putting a single
extra dll in the binary distribution. All the places
using tclWinProcs->useWide (21 in total) can be
simplified.
User Comments: nijtmans added on 2010-08-14 23:49:12:

allow_comments - 1

nijtmans added on 2010-08-14 23:49:11:
No reason for this any more

hobbs added on 2010-08-05 04:48:15:
Just an fyi that 8.6 now panics if you even try to run it on Win9x, so perhaps we focus 8.6 on just re-writing all the non-unicode to force unicode only on Windows.

hobbs added on 2009-08-21 03:07:39:
I support moving the head (even 8.5) to only mslu-based.  We agreed to this already, but noone had the time to do the streamlining you appear to have done.  There is no reason to maintain a Win9x-based support path for the latest stable releases.

nijtmans added on 2009-08-16 17:40:55:
Adds implementation, which allows to compile Tcl in two ways: without mslu support and with mslu support. Without mslu, everything is as before.
But when unicows.lib is available (detected in the configure script), then an
additional runtime check is done whether we are running on <WinNT and if
unicows.dll is available. If so, then the "unicode" encoding is used internally and unicows.dll is loaded to perform all necessary conversions.

This way doesn't have any disadvantage: everything still works unchanged
on Win95/98/ME, but there is a single potential incompatibility: The
function Tcl_WinUtfToTChar currently always uses the system encoding
when running on Win95/98/ME, but with this change it might start to
use the "unicode" encoding in stead. Code which depend on that
(like Tk!) will have to be adapted, but the modification is trivial.

I hope that this change could be accepted for Tcl 8.6, I don't think
a TIP is needed for that. But someone with

This patch will only work after compat/mslu/unicows.dll is
checked in, but this file is redistributable so that doesn't
cause any legal problems. The file unicows.lib is - unfortunately -
not redistributable, but it is available from any newer Microsoft SDK.

Any feedback is welcome.

nijtmans added on 2009-08-16 17:27:31:

File Added - 339357: patch.txt

Attachments: