imgtools/romtools/rombuild/r_build.cpp
changeset 640 ac0bbc1e5d79
parent 626 ac03b93ca9c4
child 699 9ca650050cf0
equal deleted inserted replaced
639:0e65f93be3cb 640:ac0bbc1e5d79
    33 #include <iomanip> 
    33 #include <iomanip> 
    34 #include "r_obey.h"
    34 #include "r_obey.h"
    35 #include "r_global.h"
    35 #include "r_global.h"
    36 #include "r_dir.h"
    36 #include "r_dir.h"
    37 
    37 
       
    38 #include "uniconv.hpp"
    38 TInt NumRootDirs;
    39 TInt NumRootDirs;
       
    40 extern TBool gIsOBYUTF8;
    39 
    41 
    40 inline TLinAddr ActualToRomAddress(TAny* anAddr) { 
    42 inline TLinAddr ActualToRomAddress(TAny* anAddr) { 
    41 	return TLinAddr(anAddr)-TheRomMem+TheRomLinearAddress; 
    43 	return TLinAddr(anAddr)-TheRomMem+TheRomLinearAddress; 
    42 }
    44 }
    43 
    45 
   721 iResource(EFalse), iNonXIP(EFalse), iPreferred(EFalse), iCompression(0), iPatched(EFalse),iArea(0),
   723 iResource(EFalse), iNonXIP(EFalse), iPreferred(EFalse), iCompression(0), iPatched(EFalse),iArea(0),
   722 iOverrideFlags(0),iCodeAlignment(0),iDataAlignment(0),iUid1(0), iUid2(0), iUid3(0),iBareName(0), 
   724 iOverrideFlags(0),iCodeAlignment(0),iDataAlignment(0),iUid1(0), iUid2(0), iUid3(0),iBareName(0), 
   723 iHardwareVariant(KVariantIndependent),iDataBssOffset(0xffffffff), 
   725 iHardwareVariant(KVariantIndependent),iDataBssOffset(0xffffffff), 
   724 iStackReserve(0),iIATRefs(0), iNext(0), iNextInArea(0), 
   726 iStackReserve(0),iIATRefs(0), iNext(0), iNextInArea(0), 
   725 iRomImageFlags(0),iProcessName(0), iRomNode(NULL) {
   727 iRomImageFlags(0),iProcessName(0), iRomNode(NULL) {
   726 	if (aFileName){
   728 	if (aFileName)
       
   729 	{
   727 		if(iFileName)
   730 		if(iFileName)
   728 			delete []iFileName;
   731 			delete []iFileName;
   729 		iFileName = NormaliseFileName(aFileName);	 
   732 		iFileName = NormaliseFileName(aFileName);	 
       
   733    		if(gIsOBYUTF8 && !UniConv::IsPureASCIITextStream(iFileName))
       
   734    		{
       
   735 			char* tempnname = strdup(iFileName);
       
   736 			unsigned int namelen = 0;
       
   737 			if(UniConv::UTF82DefaultCodePage(tempnname, strlen(tempnname), &iFileName, &namelen) < 0)
       
   738 				Print(EError, "Invalid filename encoding: %s\n", tempnname);
       
   739 			free(tempnname);
       
   740    		}
   730 	}
   741 	}
   731 	if (aName)
   742 	if (aName)
       
   743 	{
   732 		iName = NormaliseFileName(aName);
   744 		iName = NormaliseFileName(aName);
       
   745 		if(!gIsOBYUTF8 && !UniConv::IsPureASCIITextStream(iName))
       
   746 		{
       
   747 			char* tempnname = strdup(iName);
       
   748 			unsigned int namelen = 0;
       
   749 			if(UniConv::DefaultCodePage2UTF8(tempnname, strlen(tempnname), &iName, &namelen) < 0)
       
   750 				Print(EError, "Invalid filename encoding: %s\n", tempnname);
       
   751 			free(tempnname);
       
   752 		}
       
   753 	}
   733 }
   754 }
   734 //
   755 //
   735 // Destructor
   756 // Destructor
   736 //
   757 //
   737 TRomBuilderEntry::~TRomBuilderEntry() {
   758 TRomBuilderEntry::~TRomBuilderEntry() {