--- a/Symbian3/PDK/Source/GUID-66470976-7B8B-582B-B32B-4010C95052FF.dita Thu Mar 11 15:24:26 2010 +0000
+++ b/Symbian3/PDK/Source/GUID-66470976-7B8B-582B-B32B-4010C95052FF.dita Thu Mar 11 18:02:22 2010 +0000
@@ -1,12 +1,12 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
-<!-- This component and the accompanying materials are made available under the terms of the License
-"Eclipse Public License v1.0" which accompanies this distribution,
-and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
-<!-- Initial Contributors:
- Nokia Corporation - initial contribution.
-Contributors:
--->
-<!DOCTYPE concept
- PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
+<!-- This component and the accompanying materials are made available under the terms of the License
+"Eclipse Public License v1.0" which accompanies this distribution,
+and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
+<!-- Initial Contributors:
+ Nokia Corporation - initial contribution.
+Contributors:
+-->
+<!DOCTYPE concept
+ PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
<concept xml:lang="en" id="GUID-66470976-7B8B-582B-B32B-4010C95052FF"><title>Compressed Unicode resource format</title><prolog><metadata><keywords/></metadata></prolog><conbody><p>This page describes the compressed resource file format introduced from Symbian OS v7.0. </p> <p>This format compresses, for those cases where actual benefit is yielded by compressing, Unicode text-strings in the resource data by using the Standard Compression Scheme for Unicode, described in <xref scope="external" href="http://www.unicode.org/unicode/reports/tr6/tr6-3.2.html">http://www.unicode.org/unicode/reports/tr6/tr6-3.2.html</xref>. </p> <p>Resource files in this format are generated by the resource compiler from Symbian OS v7.0.</p> <table id="GUID-70D9B9A9-DD57-5996-8FDB-7820F8712508"><tgroup cols="2"><colspec colname="col0"/><colspec colname="col1"/><tbody><row><entry><p><b>Number of bytes</b> </p> </entry> <entry><p><b>Description</b> </p> </entry> </row> <row><entry><p>16</p> </entry> <entry><p>These bytes store the resource file’s UIDs. </p> <p>The first twelve bytes consist of three four-byte integers (in little-endian byte order) followed by a four-byte CRC checksum generated from those three integers. </p> <p>The first UID is always 0x101f4a6b. </p> <p>The second and third UIDs can be specified on rcomp's command-line. By default, the second UID is zero and the third UID is the resource file’s “offset”, i.e. the twenty-bit integer generated from the resource file’s name. These twenty bits are stored in the least significant twenty bits of the third UID; the most significant twelve bits are all zero.</p> </entry> </row> <row><entry><p>1</p> </entry> <entry><p>This byte stores flags. Currently, there is only one flag defined, which is the lowest bit of the byte (0x01). This flag indicates whether the third UID is actually the resource file’s “offset” (see the row above). The bit is set to non-zero if it is, and zero if it is not.</p> </entry> </row> <row><entry><p>2</p> </entry> <entry><p>This two-byte integer (in little-endian byte order) stores the size in bytes of the largest resource in the file (that is, the size when uncompressed).</p> </entry> </row> <row><entry><p>number_of_resources/8 (rounded up to the nearest whole number)</p> </entry> <entry><p>This is a bit-array (one bit for each resource) storing which resources contain compressed Unicode. The least significant bit of the first byte corresponds to the first resource, the next-to-least significant bit of the first byte corresponds to the second resource, etc. A bit being set to non-zero indicates that the corresponding resource contains compressed Unicode, a zero bit indicates that it does not contain compressed Unicode.</p> </entry> </row> <row><entry><p>[any]</p> </entry> <entry><p>This contains the data for all the resources stored in order, one after another with no byte-padding between them. The format of the data for each resource is in one of two possible formats depending on whether the resource contains compressed Unicode. The bit-array described in the row above indicates which resources contain compressed Unicode. Note that resources in either of these two formats may contain <i>uncompressed</i> Unicode: this is because compressing Unicode using the Standard Compression Scheme for Unicode can, in certain conditions, yield larger output than input, hence such Unicode text-strings will <i>not</i> be compressed as it would not be beneficial. Extra padding bytes (arbitrarily 0xab) are inserted in front of any uncompressed Unicode text-string that would otherwise not be aligned on a two-byte boundary relative to the start of that resource’s data, once the resource has been uncompressed.</p> <p><i>Resources not containing compressed Unicode:</i> </p> <p>The binary data of these resources is laid out exactly as specified in the resource definition (although note the comment about padding bytes above).</p> <p><i>Resources containing compressed Unicode:</i> </p> <p>The binary data of these resources is split up into one or more sequences, or “runs”, alternating between compressed Unicode and other material. </p> <p>Each run is preceded by an integer containing the length in bytes of the run (not including the byte(s) it occupies itself). The run-length occupies a single byte if it is less than 128, otherwise it occupies two bytes (in little-endian byte order), with the most significant bit of the first byte set to non-zero to indicate that the run-length occupies two bytes. Only the length of the first run may be zero (which would be the case if the resource does not <i>start</i> with compressed Unicode).</p> </entry> </row> <row><entry><p>(number_of_resources+1)*2</p> </entry> <entry><p>This is the resource index, which is a series of two-byte integers (in little-endian byte order), one for each resource in the resource file, each storing the file-position of that resource’s data (see row immediately above). </p> <p>This is followed by a two-byte integer (in little-endian byte order), which is the file-position one byte past the end of the last resource’s data. This is so that working out the length of a resource’s data is trivially done by subtracting the file-position stored in that resource’s index-entry from the file-position in the next index-entry. </p> <p>This last entry in the resource index, which stores the file-position one byte past the end of the last resource’s data, can also be thought of as storing the file-position of the start of the resource index.</p> </entry> </row> </tbody> </tgroup> </table> </conbody></concept>
\ No newline at end of file