From -7392931607170431887
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,25a6c79e64b4e6be
X-Google-Attributes: gidf78e5,public
From: Stephen Clamage <stephen.clamage@sun.com>
Subject: Re: NUL character in basic_string
Date: 2000/10/12
Message-ID: <1k8ausskls36o3spt506d5veul47cdob6d@4ax.com>#1/1
X-Deja-AN: 680573986
Content-Transfer-Encoding: 7bit
Approved: Fergus Henderson <fjh@cs.mu.oz.au>, moderator of comp.std.c++
References: <39E4D6F8.653BA13F@vger.vsin.com>
X-Authentication-Warning: mulga.cs.mu.OZ.AU: fjh set sender to devnull@stump.algebra.com using -f
Content-Type: text/plain; charset=us-ascii
X-Complaints-To: abuse@demon.net
X-Mail2News-Path: news.demon.net!mulga.cs.mu.oz.au
X-Trace: mail2news.demon.co.uk 971358639 mail2news:3523 mail2news mail2news.demon.co.uk
Organization: @Home Network
X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov)
MIME-Version: 1.0
NNTP-Posting-Date: Wed, 11 Oct 2000 19:33:56 PDT
Reply-To: stephen.clamage@sun.com
Newsgroups: comp.std.c++

On Thu, 12 Oct 2000 00:28:23 GMT, Curtis Smith <curtis@vger.vsin.com>
wrote:

>My reading of the C++ standard leads me to believe that the basic_string
>template (string, wstring, &c.) may contain NUL characters (that is, 0
>widened to the appropriate type),

Yes.

> but some library implementors don't seem
>to support such strings.

Are you sure the limitation is in the library, and not a consequence
of how you are using the string? For example:
	string s("X\000Y");
	char buf[10];
	strcpy(buf, s.c_str());
The strcpy stops on the embedded null. That is not a limitation of
class string, but a consequence of the semantics of strcpy.

---
Steve Clamage, stephen.clamage@sun.com

---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.research.att.com/~austern/csc/faq.html                ]
[ Note that the FAQ URL has changed!  Please update your bookmarks.     ]




