digitalmars.D.learn - win32 from master: unicode functions by default?
- Andre (9/9) Nov 11 2015 Hi,
- Mike Parker (2/11) Nov 11 2015 version=Unicode on the compiler command line.
- Andre (4/17) Nov 11 2015 perfect. Thanks a lot.
- Jonathan M Davis via Digitalmars-d-learn (7/20) Nov 12 2015 It seems pretty wrong for the A versions to be the default though...
- Mike Parker (6/16) Nov 12 2015 I've gotten into the same habit. But it appears the switch to
- Kagamin (3/7) Nov 13 2015 That only declares aliases without postfix, actual declarations
- Kagamin (7/14) Nov 13 2015 For my money it's a plain bug in bindings :)
- Vladimir Panteleev (8/13) Nov 13 2015 Yep, we don't support non-Unicode Windows versions anyway so
- Kagamin (5/7) Nov 13 2015 Then you would need to do all TCHAR stuff from windows headers in
Hi, by using the win32 library from master, the functions aliases to the ansi windows functions (...A) instead of the unicode functions (...W). Is there a way to control this behavior beside using the explicit function names (A/W)? Kind regards André
Nov 11 2015
On Thursday, 12 November 2015 at 04:58:42 UTC, Andre wrote:Hi, by using the win32 library from master, the functions aliases to the ansi windows functions (...A) instead of the unicode functions (...W). Is there a way to control this behavior beside using the explicit function names (A/W)? Kind regards Andréversion=Unicode on the compiler command line.
Nov 11 2015
On Thursday, 12 November 2015 at 05:08:25 UTC, Mike Parker wrote:On Thursday, 12 November 2015 at 04:58:42 UTC, Andre wrote:perfect. Thanks a lot. Kind regards AndréHi, by using the win32 library from master, the functions aliases to the ansi windows functions (...A) instead of the unicode functions (...W). Is there a way to control this behavior beside using the explicit function names (A/W)? Kind regards Andréversion=Unicode on the compiler command line.
Nov 11 2015
On Thursday, November 12, 2015 05:08:24 Mike Parker via Digitalmars-d-learn wrote:On Thursday, 12 November 2015 at 04:58:42 UTC, Andre wrote:It seems pretty wrong for the A versions to be the default though... Still, even in C++ code, I've generally taken the approach of using the W functions explicitly in order to avoid any potential problems with A functions being called accidentally. Regardless, the whole A vs W thing with Win32 is not exactly one of its nicer features. :| - Jonathan M DavisHi, by using the win32 library from master, the functions aliases to the ansi windows functions (...A) instead of the unicode functions (...W). Is there a way to control this behavior beside using the explicit function names (A/W)? Kind regards Andréversion=Unicode on the compiler command line.
Nov 12 2015
On Thursday, 12 November 2015 at 15:58:53 UTC, Jonathan M Davis wrote:On Thursday, November 12, 2015 05:08:24 Mike Parker viaI've gotten into the same habit. But it appears the switch to dynamic loading has made it so that only the A versions or only the W versions are available. You no longer get both. https://github.com/D-Programming-Language/druntime/blob/master/src/core/sys/windows/w32api.d#L85version=Unicode on the compiler command line.It seems pretty wrong for the A versions to be the default though... Still, even in C++ code, I've generally taken the approach of using the W functions explicitly in order to avoid any potential problems with A functions being called accidentally. Regardless, the whole A vs W thing with Win32 is not exactly one of its nicer features. :| - Jonathan M Davis
Nov 12 2015
On Friday, 13 November 2015 at 05:09:12 UTC, Mike Parker wrote:I've gotten into the same habit. But it appears the switch to dynamic loading has made it so that only the A versions or only the W versions are available. You no longer get both. https://github.com/D-Programming-Language/druntime/blob/master/src/core/sys/windows/w32api.d#L85That only declares aliases without postfix, actual declarations are available unconditionally barring a few bugs.
Nov 13 2015
On Thursday, 12 November 2015 at 15:58:53 UTC, Jonathan M Davis wrote:It seems pretty wrong for the A versions to be the default though...For my money it's a plain bug in bindings :)Still, even in C++ code, I've generally taken the approach of using the W functions explicitly in order to avoid any potential problems with A functions being called accidentally. Regardless, the whole A vs W thing with Win32 is not exactly one of its nicer features. :|In C headers it's a backward compatibility for code written for win9x. As such it doesn't make much sense for new code and especially for D code. The mess is a price for thoughtless copying.
Nov 13 2015
On Friday, 13 November 2015 at 08:10:12 UTC, Kagamin wrote:On Thursday, 12 November 2015 at 15:58:53 UTC, Jonathan M Davis wrote:Yep, we don't support non-Unicode Windows versions anyway so there's no reason for this. It's not as important as in C though, since TCHAR does not have a big role in D - you will need to be explicit to which character type you convert to when converting from D strings anyway. If only Microsoft would have adopted UTF-8 as an 8-bit locale... if only.It seems pretty wrong for the A versions to be the default though...For my money it's a plain bug in bindings :)
Nov 13 2015
On Friday, 13 November 2015 at 08:44:33 UTC, Vladimir Panteleev wrote:If only Microsoft would have adopted UTF-8 as an 8-bit locale... if only.Then you would need to do all TCHAR stuff from windows headers in order to conditionally compile for utf-8 for say Windows 20 and for utf-16 for previous versions.
Nov 13 2015