Subject: Re: [boost] [general] What will stringhandling inC++ looklike inthe future [was Always treat ... ]
From: Peter Dimov (pdimov_at_[hidden])
Date: 2011-01-19 17:07:18
Dave Abrahams wrote:
> At Wed, 19 Jan 2011 23:02:02 +0200,
> Peter Dimov wrote:
> > My answer is different. T is std::string, and:
> > - on POSIX OSes, this string is taken directly from the OS and given
> > directly to the OS, without any conversion;
> > - on Windows, this string is UTF-8 and is converted to UTF-16 before
> > being given to the OS, and converted from UTF-16 after being received
> > from it. This conversion should tolerate broken UTF-16 because the OS
> > does so as well.
> I prefer to have semantic constraints/invariants like "this is UTF-8
> encoded" represented in the type system and enforced by public library
> interfaces. I'm arguing for a future like that.
But the semantics I outlined above only have this constraint under Windows.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk