On 02/12/2012 05:30 PM, Steven D'Aprano wrote:
On Sun, 12 Feb 2012 05:11:30 -0600, Andrew Berg wrote:
On 2/12/2012 3:12 AM, Steven D'Aprano wrote:
<snip>
Windows has two separate APIs, one for "wide" characters, the other for
single bytes. Depending on which one you use, the directory will appear
to be called Наӥв or 0å2.
Yes, and AFAIK, the wide API is the default. The other one only exists
to support programs that don't support the wide API (generally, such
programs were intended to be used on older platforms that lack that
API).
I'm not sure that "default" is the right word, since (as far as I know)
both APIs have different spelling and the coder has to make the choice
whether to call function X or function Y. Perhaps you mean that Microsoft
encourages the wide API and makes the single-byte API available for
legacy reasons?
When I last looked, the pair of functions were equivalently available,
and neither one was named the way you'd expect. One had a suffix of A
and the other had a suffix of W (guess which was which). C header
definitions used #define to define the actual functions, and the
preprocessor effectively stuck A's on all of them or W's on all of
them. Very bulky, but buried in some MS header files.
Other languages were free to use either or both. VB used just the W
versions, as I presume java does.
But the interesting point was that for most of these functions, the A
versions were native on Win95-derived OS'es, while the W versions were
native on NT-derived OS's. There were translation DLL's which supplied
the secondary versions. So in the old days it was more efficient to use
the A versions. No longer true, since as far as I know, nobody that
still uses Win ME, Win98, or Win95 is targeted for much new programming.
--
DaveA
--
http://mail.python.org/mailman/listinfo/python-list