220 29348 <a6b76054-436c-9f0f-db6d-f93b95c63938@gmail.com> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Andrey Semashev <andrey.semashev@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: std::byte thoughts
Date: Wed, 2 Nov 2016 17:50:56 +0300
Lines: 23
Approved: news@gmane.org
Message-ID: <a6b76054-436c-9f0f-db6d-f93b95c63938@gmail.com>
References: <7da80620-e4bd-40eb-a4ec-4f3c2dcb2c98@isocpp.org>
 <1549171.TC16PSHVVd@tjmaciei-mobl1>
 <d3d99972-8135-44d0-9674-69d94141d0fb@isocpp.org>
 <2350841.Z7lUCKSumT@tjmaciei-mobl1>
 <3e64b220-79ae-4108-ba1c-9785494fc434@isocpp.org>
 <97ebfc84-c5a3-eaf5-efcb-c1bdf9b507a5@gmail.com>
 <5933359a-3f59-33df-10db-e643bfa39c55@honermann.net>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
X-Trace: blaine.gmane.org 1478098300 27118 195.159.176.226 (2 Nov 2016 14:51:40 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Wed, 2 Nov 2016 14:51:40 +0000 (UTC)
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
 Thunderbird/45.4.0
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCXY5TXHWYJRBU7247AAKGQEYSEV2YQ@isocpp.org Wed Nov 02 15:51:36 2016
Return-path: <std-proposals+bncBCXY5TXHWYJRBU7247AAKGQEYSEV2YQ@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-wm0-f71.google.com ([74.125.82.71])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBCXY5TXHWYJRBU7247AAKGQEYSEV2YQ@isocpp.org>)
	id 1c1wsT-0002AP-U7
	for gclcip-std-proposals@m.gmane.org; Wed, 02 Nov 2016 15:50:57 +0100
Original-Received: by mail-wm0-f71.google.com with SMTP id l124sf12100991wml.4
        for <gclcip-std-proposals@m.gmane.org>; Wed, 02 Nov 2016 07:51:00 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=subject:to:references:from:message-id:date:user-agent:mime-version
         :in-reply-to:x-original-sender:x-original-authentication-results
         :reply-to:precedence:mailing-list:list-id:x-spam-checked-in-group
         :list-post:list-help:list-archive:list-subscribe:list-unsubscribe;
        bh=jWSn9tDwKiGjHEE8e7Dxc/ye5m1bNWuuiMDgP1WkzLc=;
        b=ITpfdwTf+vkKtvWguOhgntLYRS0X7s54Bvbubhbba1ks5hOAJU8YQf4UMoGNX/LIrb
         AEtyIyFFvuZxu076LsYqe7oh2hlNqgvgWhqyclVlBYDZuYDu+1fgORijVmlck7cF/ssx
         TaIiM5uEf7jt3v0Wxshf+N4r5buVvi6LZlxTmWmhE7eMxESkoQ1sN+1ps6+xHgWZg4mH
         zt4f7I9ilQxJw94hcwAoV9jsT00DvPC+Pq32KfABf1eaF/GOpSk8EmkhOYrAWXM7Acak
         l2ku4xcuVMpSzbnbr2aync7kVco7ZSO+3WmF7n92Oei5wQm9y+h2b5KnnFi6bihLzSaT
         XgCA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:subject:to:references:from:message-id:date
         :user-agent:mime-version:in-reply-to:x-original-sender
         :x-original-authentication-results:reply-to:precedence:mailing-list
         :list-id:x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=jWSn9tDwKiGjHEE8e7Dxc/ye5m1bNWuuiMDgP1WkzLc=;
        b=YqNeAdTVV+XWSvi6e37qjE+KIeMAwYyDR/D7HQYdMqhyGA4y1RSJqBrtXKI7cfizPg
         DbgxHJM8b6F6+c1gmkp/urgXaaQPM43ZrTT3TpXYezxAKKG3GR6jocXUioOCJUX2b5PN
         to6eM2LYnEfraJ5VmOpzvNw8lMfKERaMReCJ3xevOmR65cjwL+SqsK1DAA4YjeZBgVJo
         e9ecY3fwwd1Cgh+eLwKN1D0BvZ3yZ3MhmVsQLIj38v5qwb1xdeqfIrHBauHJlO9kdmjZ
         2WN67LQb/n8B7UlBVF1UzJ6wvq42kYRr38zb9tuADmvbHdthel4tYyZ9jYvVm1qRcvpc
         8u1g==
X-Gm-Message-State: ABUngveLDXONIHd4WYrq51cbsbyULtgA2GYt2nEkJ7n5UzV+/cVTF5a8IsfhinekzHKD/w==
X-Received: by 10.28.197.6 with SMTP id v6mr435020wmf.13.1478098260539;
        Wed, 02 Nov 2016 07:51:00 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.25.215.164 with SMTP id q36ls545907lfi.16.gmail; Wed, 02 Nov
 2016 07:50:58 -0700 (PDT)
X-Received: by 10.25.125.84 with SMTP id y81mr1993542lfc.37.1478098258902;
        Wed, 02 Nov 2016 07:50:58 -0700 (PDT)
Original-Received: from mail-lf0-x22a.google.com (mail-lf0-x22a.google.com. [2a00:1450:4010:c07::22a])
        by mx.google.com with ESMTPS id n76si1695474lfi.40.2016.11.02.07.50.58
        for <std-proposals@isocpp.org>
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Wed, 02 Nov 2016 07:50:58 -0700 (PDT)
Received-SPF: pass (google.com: domain of andrey.semashev@gmail.com designates 2a00:1450:4010:c07::22a as permitted sender) client-ip=2a00:1450:4010:c07::22a;
Original-Received: by mail-lf0-x22a.google.com with SMTP id t196so14838417lff.3
        for <std-proposals@isocpp.org>; Wed, 02 Nov 2016 07:50:58 -0700 (PDT)
X-Received: by 10.25.163.132 with SMTP id m126mr2415314lfe.9.1478098258278;
        Wed, 02 Nov 2016 07:50:58 -0700 (PDT)
Original-Received: from [192.168.1.2] (broadband-90-154-68-136.nationalcablenetworks.ru. [90.154.68.136])
        by smtp.googlemail.com with ESMTPSA id o194sm530069lfo.42.2016.11.02.07.50.57
        for <std-proposals@isocpp.org>
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Wed, 02 Nov 2016 07:50:57 -0700 (PDT)
In-Reply-To: <5933359a-3f59-33df-10db-e643bfa39c55@honermann.net>
X-Original-Sender: andrey.semashev@gmail.com
X-Original-Authentication-Results: mx.google.com;       dkim=pass
 header.i=@gmail.com;       spf=pass (google.com: domain of
 andrey.semashev@gmail.com designates 2a00:1450:4010:c07::22a as permitted
 sender) smtp.mailfrom=andrey.semashev@gmail.com;       dmarc=pass (p=NONE
 dis=NONE) header.from=gmail.com
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Google-Group-Id: 399137483710
List-Post: <https://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <https://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <https://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>,
 <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:29348
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/29348>

On 11/02/16 17:01, Tom Honermann wrote:
> On 11/02/2016 05:02 AM, Andrey Semashev wrote:
>> Assuming that code units are always positive (which I don't think is
>> mandated anywhere, but let's keep things sane),
>
> I don't know of any encodings that specify negative values for code
> units or code points.  However, the mapping of UTF-8 code units to char
> results in negative code unit values in UTF-8 strings for
> implementations that use a signed 8-bit char.  So, in practice, sanity
> does not always prevail.  This is one of the motivations for P0482R0
> <http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0482r0.html>.

AFAIR, Unicode does not define negative code units. The fact that code 
units greater than 0x7f cannot be represented in 8-bit signed `char` 
simply means overflow and implementation-defined behavior. In other 
words, UTF-8 code units cannot be represented by `char` on such platforms.

-- 
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/a6b76054-436c-9f0f-db6d-f93b95c63938%40gmail.com.

.
