Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.forth > #39679

Re: RfD: 1 chars = 1

From Bernd Paysan <bernd.paysan@gmx.de>
Newsgroups comp.lang.forth
Subject Re: RfD: 1 chars = 1
Date 2015-06-10 14:46 +0200
Organization A noiseless patient Spider
Message-ID <ml9bh4$cg0$1@dont-email.me> (permalink)
References (2 earlier) <ml4ofn$bg$1@dont-email.me> <ml7m4e$7pp$1@dont-email.me> <ml7qf6$qj4$1@dont-email.me> <ml7thi$41j$1@dont-email.me> <ml82b2$h75$1@dont-email.me>

Show all headers | View raw


Alex McDonald wrote:
> Yes, I read your text. What you're suggesting isn't possible. The
> codepage is set for the entire OS and *A calls do not provide specific
> codepages.

Yes, it's severely broken, SetLocaleInfoA (the one which allows you to set 
the locale) is user-global, and affects all running applications.  I also 
understand that Microsoft's codebase is so unmaintainable that you couldn't 
change that to become a per-application setting.

If Microsoft was not just a bunch of incompetent code-monkeys, they could 
change the already available conversion function for *A strings to be per-
application, and add a locale ID that uses CP_UTF8, and then, we would have 
first-class UTF-8 support.  As a "quick hack" (something Microsoft really 
likes, because design is not their strength), they could even implement only 
that UTF-8 option per-application, so when you use a new UseCodepageUTF8A() 
call, the *A conversion function would do UTF-8/UTF-16 conversion instead of 
going through the current code page.

> It is possible to overide and use codepage 65001 (UTF-8) for
> the command line processor (the "DOS console") but that isn't possible
> for windowed apps, and it only affects input and output to the console.

Yes, that's because Microsoft didn't implement this.  I know this.  But the 
framework generally allows this, and it would IMHO be a relatively small 
change in the system to actually do it.  All it would require is some 
intelligence, which unfortunately is unavailable and unobtainable at 
Microsoft.

> "A Windows operating system always has one currently active Windows code
> page. All ANSI versions of API functions use the currently active code
> page." https://msdn.microsoft.com/en-> us/library/windows/desktop/dd317752%28v=vs.85%29.aspx

There's actually a system active code page and an "active code page", which 
is per-user.  The per-user codepage is set by SetLocaleInfoA, and doesn't 
affect the other users.  So at least they have already a way to deal with 
different code pages active at the same time (at least in Windows Terminal 
Server, which supports real multi-user).

>> It doesn't matter if UTF-8 postdated Windows NT or not; which BTW
>> isn't true, either:
>> 
>> "Thompson's design was outlined on September 2, 1992, on a placemat in
>> a New Jersey diner with Rob Pike. In the following days, Pike and
>> Thompson implemented it and updated Plan 9 to use it throughout, and
>> then communicated their success back to X/Open.[7]
>> 
>> UTF-8 was first officially presented at the USENIX conference in San
>> Diego, from January 25 to 29, 1993."
>> 
>> Windows NT was released 26. Juli 1993.
> 
> http://tools.ietf.org/html/rfc2044 didn't get ratified by the IETF until
> October 1996. It mentions ISO/IEC 10646-1:1993: "UTF-8 is described in
> Annex R, adopted but not yet published." UTF-8 also made an appearance in
> Unicode 1.1, but the documents date from late 1992, and were published in
> 1993. They aren't available online on the Unicode website.

Microsoft often bases their stuff on early drafts.  CP1252 was based on an 
early ANSI draft, which became ISO-8859-1 years later.  The discrepancy 
between the early draft and the ISO standard is very obvious.  As Microsoft 
was spearheading Unicode, I'd suppose that they did contribute and 
participate in all related events.  The need for a ASCII-compatible byte-
encoding for Unicode became apparent in early 1992.

> It would not have been possible or advisable to change the design of
> Windows NT between January and July 1993 based on a USENIX paper, or a
> Unicode standard published in 1993; both would have been well beyond the
> end of the design phase of Windows NT.

The design of Windows NT supports variable-width ASCII-compatible code 
pages, so no need to change the design.  Just implement that particular code 
page as first-class locale, which is distributed with every localized 
Windows version (like CP1252, which also is available everywhere).

Microsoft has also shown other incapabilites with i18n, e.g. it took them 
until Vista to deviler a universal distribution which can be set to whatever 
language you liked to, instead of buying the localized version.  And that 
multi-language Vista was only half-baked.

-- 
Bernd Paysan
"If you want it done right, you have to do it yourself"
net2o ID: kQusJzA;7*?t=uy@X}1GWr!+0qqp_Cn176t4(dQ*
http://bernd-paysan.de/

Back to comp.lang.forth | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

RfD: 1 chars = 1 anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-06-08 17:34 +0000
  Re: RfD: 1 chars = 1 Paul Rubin <no.email@nospam.invalid> - 2015-06-08 10:59 -0700
    Re: RfD: 1 chars = 1 "Alex McDonald" <blog@rivadpm.com> - 2015-06-08 19:57 +0100
      Re: RfD: 1 chars = 1 Michael Barry <barrym95838@yahoo.com> - 2015-06-08 16:35 -0700
        Re: RfD: 1 chars = 1 anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-06-09 06:18 +0000
      Re: RfD: 1 chars = 1 Bernd Paysan <bernd.paysan@gmx.de> - 2015-06-09 23:35 +0200
        Re: RfD: 1 chars = 1 "Alex McDonald" <blog@rivadpm.com> - 2015-06-09 23:49 +0100
          Re: RfD: 1 chars = 1 Bernd Paysan <bernd.paysan@gmx.de> - 2015-06-10 01:41 +0200
            Re: RfD: 1 chars = 1 "Alex McDonald" <blog@rivadpm.com> - 2015-06-10 02:03 +0100
              Re: RfD: 1 chars = 1 anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-06-10 12:22 +0000
                Re: RfD: 1 chars = 1 "Alex McDonald" <blog@rivadpm.com> - 2015-06-11 14:50 +0100
              Re: RfD: 1 chars = 1 Bernd Paysan <bernd.paysan@gmx.de> - 2015-06-10 14:46 +0200
    Re: RfD: 1 chars = 1 anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-06-09 07:09 +0000
      Re: RfD: 1 chars = 1 Stefan Mauerhofer <smauerhofer@androsoft.ch> - 2015-06-09 01:52 -0700
      Re: RfD: 1 chars = 1 Bernd Paysan <bernd.paysan@gmx.de> - 2015-06-09 23:29 +0200
      Re: RfD: 1 chars = 1 David Thompson <dave.thompson2@verizon.net> - 2015-06-21 12:46 -0400
  Re: RfD: 1 chars = 1 Matthias Koch <matthias.koch@hot.uni-hannover.de> - 2015-06-09 12:06 +0200
    Re: RfD: 1 chars = 1 Mark Wills <markwills1970@gmail.com> - 2015-06-09 03:40 -0700
      Re: RfD: 1 chars = 1 Matthias Koch <matthias.koch@hot.uni-hannover.de> - 2015-06-09 12:45 +0200
        Re: RfD: 1 chars = 1 rickman <gnuarm@gmail.com> - 2015-06-09 07:17 -0400
          Re: RfD: 1 chars = 1 Matthias Koch <matthias.koch@hot.uni-hannover.de> - 2015-06-09 14:30 +0200
      Re: RfD: 1 chars = 1 "Elizabeth D. Rather" <erather@forth.com> - 2015-06-09 12:50 -0800
        Re: RfD: 1 chars = 1 "HAA" <someone@microsoft.com> - 2015-06-21 17:14 +1000
          Re: RfD: 1 chars = 1 "Elizabeth D. Rather" <erather@forth.com> - 2015-06-20 21:46 -1000
            Re: RfD: 1 chars = 1 "HAA" <someone@microsoft.com> - 2015-06-23 15:05 +1000
              Re: RfD: 1 chars = 1 "Elizabeth D. Rather" <erather@forth.com> - 2015-06-22 19:42 -1000
                Re: RfD: 1 chars = 1 "HAA" <someone@microsoft.com> - 2015-06-27 14:08 +1000

csiph-web