From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.182.186.73 with SMTP id fi9mr1326273obc.48.1381956492018; Wed, 16 Oct 2013 13:48:12 -0700 (PDT) X-Received: by 10.50.36.67 with SMTP id o3mr138023igj.1.1381956491955; Wed, 16 Oct 2013 13:48:11 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!news.glorb.com!i2no16268975qav.0!news-out.google.com!9ni46435qaf.0!nntp.google.com!o2no8717068qas.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Wed, 16 Oct 2013 13:48:11 -0700 (PDT) In-Reply-To: <14357314-5521-4275-9949-9ea42c790147@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=66.126.103.122; posting-account=RxNzCgoAAACA5KmgtFQuaU-WaH7rjnAO NNTP-Posting-Host: 66.126.103.122 References: <14357314-5521-4275-9949-9ea42c790147@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <12b085dd-8e96-477e-bbf3-135330275b69@googlegroups.com> Subject: Re: Passing a String to a C/C++ Subprogram (Special Case) From: Adam Beneschan Injection-Date: Wed, 16 Oct 2013 20:48:11 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Xref: news.eternal-september.org comp.lang.ada:17446 Date: 2013-10-16T13:48:11-07:00 List-Id: On Wednesday, October 16, 2013 1:17:32 PM UTC-7, sbelm...@gmail.com wrote: > Is it not also true that an Ada Character is not necessarily the same map= ping as a C char? If the C program has to output the glyphs and not just d= eal with the bytes, I would think it would be subject to things like the cu= rrent code page, etc. While that may be true, I don't know that it means much of anything. The m= eaning of a "char" in C is whatever the person writing the code intended it= to mean. "char" types are the only 8-bit integer types in C, so a "char" = can be used to represent a byte from a binary file, a character in the Lati= n-1 character set, a character in some other 256-character subset of Unicod= e, a portion of a multi-byte character in the UTF-8 representation of a cha= racter, a Boolean value, or anything else that fits in 8 bits. So you can'= t take anything for granted and you pretty much have to know what you're do= ing, which is the case any time you're working with C anyway. Hopefully we= can presume that Eryndlia has already thought about this and knows what va= lues the C code she's interfacing to is expecting to be in those bytes. -- Adam =20