diff -urN rcomp-7.0.1-2-orig/inc/rcbinstr.h rcomp-7.0.1-working/inc/rcbinstr.h
--- rcomp-7.0.1-2-orig/inc/rcbinstr.h	2005-09-04 01:09:10.000000000 +0300
+++ rcomp-7.0.1-working/inc/rcbinstr.h	2005-09-04 01:10:13.000000000 +0300
@@ -21,6 +21,7 @@
 	RCBinaryStream();
 	~RCBinaryStream();
 	void OpenForAppend(const String& aFileName);
+	void Open(const String& aFileName);
 	int IsOpen();
 	RCBinaryStream& operator<<(char aChar);
 	RCBinaryStream& operator<<(char* aCharPtr);
diff -urN rcomp-7.0.1-2-orig/src/main.cpp rcomp-7.0.1-working/src/main.cpp
--- rcomp-7.0.1-2-orig/src/main.cpp	2005-09-04 01:09:06.000000000 +0300
+++ rcomp-7.0.1-working/src/main.cpp	2005-09-04 02:05:24.000000000 +0300
@@ -26,6 +26,8 @@
 extern NameIdMap* pResourceNameIds;
 extern long CurrentId;
 
+int symbianV6hack = 0;
+
 void WriteHeaderFile(FILE* aRSG, IndexTable& aIndex)
 	{
 	IndexTableIterator next(aIndex);
@@ -74,7 +76,7 @@
 		}
 	}
 
-void WriteBinaryResourceData(RCBinaryStream& aRSC, IndexTable& aIndex, int& aSizeOfLargestResourceWhenUncompressed)
+int WriteBinaryResourceData(RCBinaryStream& aRSC, IndexTable& aIndex, int& aSizeOfLargestResourceWhenUncompressed)
 	{
 	IndexTableIterator next(aIndex);
 	IndexTableItem * p;
@@ -83,6 +85,7 @@
 		p->SetOffset(aRSC.GetPosition()); // record start of this resource in the index
 		p->Resource().StreamOut(aRSC, aSizeOfLargestResourceWhenUncompressed); // write out binary form of resource
 		}
+	return aRSC.GetPosition();
 	}
 
 void WriteResourceFile(RCBinaryStream& aRSC, IndexTable& aIndex, LinkArray& aLinks, bool aThirdUidIsOffset)
@@ -92,18 +95,34 @@
 		{
 		flags|=0x01;
 		}
-	aRSC << flags; // these flags are to be used only by a dictionary-compressing program rather than to be used directly by Bafl when reading non-dictionary-compressed resource files (as output by Rcomp)
+	if (!symbianV6hack)
+		{
+		aRSC << flags; // these flags are to be used only by a dictionary-compressing program rather than to be used directly by Bafl when reading non-dictionary-compressed resource files (as output by Rcomp)
+		}
 	const int positionToOverWriteFrom=aRSC.GetPosition();
 	NumericValue twoByteSizeOfLargestResourceWhenUncompressed(L_WORD);
 	aRSC << twoByteSizeOfLargestResourceWhenUncompressed;
 	WriteBitArrayOfResourcesContainingCompressedUnicode(aRSC, aIndex); // simply makes space for the bit-array without writing anything sensible in it (as we don't yet know which resources will contain compressed Unicode)
 	int sizeOfLargestResourceWhenUncompressed=0;
-	WriteBinaryResourceData(aRSC, aIndex, sizeOfLargestResourceWhenUncompressed);
+	int offs = WriteBinaryResourceData(aRSC, aIndex, sizeOfLargestResourceWhenUncompressed);
 	aIndex.SetIndexOffset(aRSC.GetPosition());
 	aRSC << aIndex;
+	int endPos = aRSC.GetPosition();
 	aRSC.SetPosition(positionToOverWriteFrom);
-	twoByteSizeOfLargestResourceWhenUncompressed=sizeOfLargestResourceWhenUncompressed;
-	aRSC << twoByteSizeOfLargestResourceWhenUncompressed;
+	if (symbianV6hack)
+		{
+		NumericValue startPositionOfOffset(L_WORD);
+		NumericValue indexLengthInBytes(L_WORD);
+		startPositionOfOffset = offs;
+		indexLengthInBytes = (1 + endPos - offs);
+		aRSC << startPositionOfOffset;
+		aRSC << indexLengthInBytes;
+		}
+	else
+		{
+		twoByteSizeOfLargestResourceWhenUncompressed=sizeOfLargestResourceWhenUncompressed;
+		aRSC << twoByteSizeOfLargestResourceWhenUncompressed;
+		}
 	WriteBitArrayOfResourcesContainingCompressedUnicode(aRSC, aIndex); // overwrites the bit array with correct data
 	aLinks.OverwriteLinks(aRSC); // this jumps about all over the place, overwriting anywhere where there is a LINK or LLINK
 
@@ -121,6 +140,7 @@
 	cerr << "\tp" << "\tParser debugging" << endl;
 	cerr << endl;
 	cerr << "\tu" << "\tGenerate Unicode resource binary" << endl;
+	cerr << "\t6" << "\tGenerate Symbian OS V6 binary" << endl;
 	cerr << endl;
 	cerr << "If no source file is specified, the source will be read from standard input." << endl;
 	cerr << "(-i is used to specify the file given to the preprocessor this " << endl;
@@ -227,6 +247,13 @@
 					TargetCharacterSet = String::Unicode;
 					}
 
+				if(strchr(settings, '6'))
+					{
+					SourceCharacterSet = String::CP1252;
+					TargetCharacterSet = String::Unicode;
+					symbianV6hack = 1;
+					}
+
 				if(strchr(settings, 'v') || strchr(settings, 'V') )
 					vParam = 1;
 				if(strchr(settings, 'p') || strchr(settings, 'P'))
@@ -291,26 +318,33 @@
 			}
 
 		char uidcrc_params[256];
-		const int ret = snprintf(uidcrc_params,
-					 sizeof(uidcrc_params),
-					 "%s %s %s %s %s",
-					 uidcrcTool,
-					 uidcrcUIDs[0],
-					 uidcrcUIDs[1],
-					 uidcrcUIDs[2],
-					 DataOutputFileName.GetBuffer());
-		if(ret <= 0) {
-			cerr << "Failed to write UIDs to " << DataOutputFileName << endl;
-			exit(ret);
-		}
-		const int error = system(uidcrc_params);
-		if(error != 0)
+		if (!symbianV6hack)
 			{
-			cerr << "Failed to write UIDs to " << DataOutputFileName << endl;
-			exit(error);
+			const int ret = snprintf(uidcrc_params,
+					sizeof(uidcrc_params),
+					"%s %s %s %s %s",
+					uidcrcTool,
+					uidcrcUIDs[0],
+					uidcrcUIDs[1],
+					uidcrcUIDs[2],
+					DataOutputFileName.GetBuffer());
+			if(ret <= 0)
+				{
+				cerr << "Failed to write UIDs to " << DataOutputFileName << endl;
+				exit(ret);
+				}
+			const int error = system(uidcrc_params);
+			if(error != 0)
+				{
+				cerr << "Failed to write UIDs to " << DataOutputFileName << endl;
+				exit(error);
+				}
 			}
 		RCBinaryStream RSCStream;
-		RSCStream.OpenForAppend(DataOutputFileName);
+		if (symbianV6hack)
+			RSCStream.Open(DataOutputFileName);
+		else
+			RSCStream.OpenForAppend(DataOutputFileName);
 		if(! RSCStream.IsOpen())
 			{
 			cerr << "Failed to open " << DataOutputFileName << endl;
diff -urN rcomp-7.0.1-2-orig/src/rcbinstr.cpp rcomp-7.0.1-working/src/rcbinstr.cpp
--- rcomp-7.0.1-2-orig/src/rcbinstr.cpp	2005-09-04 01:09:06.000000000 +0300
+++ rcomp-7.0.1-working/src/rcbinstr.cpp	2005-09-04 01:52:53.000000000 +0300
@@ -15,6 +15,8 @@
 extern long CurrentId;
 extern RCTypeArray gTypes;
 
+extern int symbianV6hack;
+
 RCBinaryStream::RCBinaryStream()
 	{}
 
@@ -33,6 +35,12 @@
 	iOs.open( FileName.GetBuffer(), ios::out | ios::in | ios::binary | ios::ate);
 	}
 
+void RCBinaryStream::Open(const String& FileName)
+	{
+	assert( !IsOpen());
+	iOs.open( FileName.GetBuffer(), ios::out | ios::binary | ios::trunc);
+	}
+
 int RCBinaryStream::IsOpen()
 	{
 	return(iOs.is_open());
@@ -283,9 +291,11 @@
 				++i; // skip a loop iteration - we know that EMarkType_StartOfCompressedUnicodeRun marks are always followed by a EMarkType_EndOfCompressedUnicodeRun mark
 				Mark& nextMark=iArrayOfMarks.MarkAt(i);
 				assert(nextMark.iMarkType==EMarkType_EndOfCompressedUnicodeRun);
-				const int numberOfBytesWhenCompressed=nextMark.iBufferPosition-mark.iBufferPosition;
+				const int numberOfBytesWhenCompressed= (symbianV6hack) ? (numberOfBytesWhenUncompressed + 100) : (nextMark.iBufferPosition-mark.iBufferPosition);
 				assert((numberOfBytesWhenCompressed>0) || !encounteredCompressedUnicode[pass]); // compressed-Unicode runs are of non-zero size apart from the compulsory initial compressed-Unicode run if the resource does not actually start with compressed Unicode
-				assert((numberOfBytesWhenCompressed<numberOfBytesWhenUncompressed) || ((!encounteredCompressedUnicode[pass]) && (numberOfBytesWhenCompressed==0) && (numberOfBytesWhenUncompressed==0)));
+				if (!symbianV6hack) {
+					assert((numberOfBytesWhenCompressed<numberOfBytesWhenUncompressed) || ((!encounteredCompressedUnicode[pass]) && (numberOfBytesWhenCompressed==0) && (numberOfBytesWhenUncompressed==0)));
+				}
 				if (pass==0)
 					{
 					addressToWriteSizeOfCompressedIntegerTo=&nextMark.iOtherData; // iOtherData in "other-stuff" runs (i.e. the second run, the fourth run, the sixth run, etc) stores the combined size of the run taking into account any extra bytes caused by other marks, e.g. a padding byte caused by a ETwoByteAlignmentPoint
@@ -487,7 +497,13 @@
 		}
 
 	// copy in the uncompressed Unicode and destroying the old copy
-	memcpy(iBuffer+bufferPositionOfStartOfCompressedUnicodeRun, runWhenUncompressed.Buffer(), numberOfBytesWhenUncompressed);
+	int length = numberOfBytesWhenUncompressed/2;
+	unsigned short *buffer = (unsigned short*) runWhenUncompressed.Buffer();
+	for (int i = 0; i < length; i++)
+		{
+		iBuffer[bufferPositionOfStartOfCompressedUnicodeRun+2*i+0] = buffer[i]&0xFF;
+		iBuffer[bufferPositionOfStartOfCompressedUnicodeRun+2*i+1] = buffer[i]>>8;
+		}
 	runWhenUncompressed.Destroy();
 	}
 
