Thursday, January 14, 2016

Digest for comp.lang.c++@googlegroups.com - 20 updates in 5 topics

Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: Jan 14 01:34AM

On 13/01/2016 23:02, Christopher Pisz wrote:
> Windows.
 
> Windows is going to convert everything to wide for you anyway on any API
> call, so just pass it wchar_t * obtained from std::wstring in most cases.
 
You can't use std::wstring for Unicode in general (not Windows) as
std::wstring HAS NOTHING TO DO WITH UNICODE: as far as C++ is concerned
there are no guarantees related to the wchar_t type and Unicode.
 
Even if wchar_t can be used to encode UTF-16 on your particular platform
see the manifesto as to why UTF-16 is the worst option. If you want to
use Unicode the only two sensible options are UTF-8 and UTF-32.
 
The goal should be to make as much of your code as portable as possible
(using an appropriate layered design) which means, if you want to use
Unicode, NOT using std::wstring as much as possible (even on Windows)
sausages.
 
/Flibble
Christopher Pisz <nospam@notanaddress.com>: Jan 14 10:06AM -0600

On 1/13/2016 7:34 PM, Mr Flibble wrote:
> (using an appropriate layered design) which means, if you want to use
> Unicode, NOT using std::wstring as much as possible (even on Windows)
> sausages.
 
Why should that be the goal when 100% of customers use Windows and we
have 0 prospects asking for any other OS and 0 requests for using a
different OS in over 20 years of business? Why should I give two poops
about portability? Because its the cool thing to do?
Christopher Pisz <nospam@notanaddress.com>: Jan 14 10:56AM -0600

On 1/14/2016 10:06 AM, Christopher Pisz wrote:
> have 0 prospects asking for any other OS and 0 requests for using a
> different OS in over 20 years of business? Why should I give two poops
> about portability? Because its the cool thing to do?
 
Furthermore, what you are talking about is fantasy. When you convince
Microsoft to take the following out of Windows.h, we'll talk about it:
 
// Generic types
 
#ifdef UNICODE
typedef wchar_t TCHAR;
#else
typedef unsigned char TCHAR;

No comments: