|
1 <?xml version="1.0" encoding="utf-8"?> |
|
2 <!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. --> |
|
3 <!-- This component and the accompanying materials are made available under the terms of the License |
|
4 "Eclipse Public License v1.0" which accompanies this distribution, |
|
5 and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". --> |
|
6 <!-- Initial Contributors: |
|
7 Nokia Corporation - initial contribution. |
|
8 Contributors: |
|
9 --> |
|
10 <!DOCTYPE concept |
|
11 PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd"> |
|
12 <concept id="GUID-A60BFFE4-E527-547C-AF4D-30BB7A1C0D07" xml:lang="en"><title>Text |
|
13 and binary data</title><shortdesc>Describes how C strings are handled in text and binary data.</shortdesc><prolog><metadata><keywords/></metadata></prolog><conbody> |
|
14 <p>In ‘C’, strings are characterised by the need for a zero terminator to |
|
15 flag the end of the string. They suffer from a number of problems. In particular, |
|
16 they cannot include binary data within them (in case that data includes binary |
|
17 zeroes) and operations on them are, in general, inefficient. ‘C’ strings need |
|
18 to be handled in a different way to binary data, as reflected in the <codeph>memxxx()</codeph> and <codeph>strxxx()</codeph> function |
|
19 groups in the ANSI ‘C’ library.</p> |
|
20 <p>Descriptors allow strings and binary data to be represented in the same |
|
21 way; this allows the same functions to be used in both cases.</p> |
|
22 <p>For binary data, the 8 bit descriptors should be used explicitly. The distinction |
|
23 between Unicode and non-Unicode has no meaning for binary data</p> |
|
24 <p>Note that there is no practical use for explicit 16 bit binary data.</p> |
|
25 </conbody></concept> |