diff -r 0e65f93be3cb -r ac0bbc1e5d79 imgtools/romtools/rombuild/r_build.cpp --- a/imgtools/romtools/rombuild/r_build.cpp Mon Sep 06 09:57:24 2010 +0100 +++ b/imgtools/romtools/rombuild/r_build.cpp Mon Sep 13 13:11:19 2010 +0800 @@ -35,7 +35,9 @@ #include "r_global.h" #include "r_dir.h" +#include "uniconv.hpp" TInt NumRootDirs; +extern TBool gIsOBYUTF8; inline TLinAddr ActualToRomAddress(TAny* anAddr) { return TLinAddr(anAddr)-TheRomMem+TheRomLinearAddress; @@ -723,13 +725,32 @@ iHardwareVariant(KVariantIndependent),iDataBssOffset(0xffffffff), iStackReserve(0),iIATRefs(0), iNext(0), iNextInArea(0), iRomImageFlags(0),iProcessName(0), iRomNode(NULL) { - if (aFileName){ + if (aFileName) + { if(iFileName) delete []iFileName; iFileName = NormaliseFileName(aFileName); + if(gIsOBYUTF8 && !UniConv::IsPureASCIITextStream(iFileName)) + { + char* tempnname = strdup(iFileName); + unsigned int namelen = 0; + if(UniConv::UTF82DefaultCodePage(tempnname, strlen(tempnname), &iFileName, &namelen) < 0) + Print(EError, "Invalid filename encoding: %s\n", tempnname); + free(tempnname); + } } if (aName) + { iName = NormaliseFileName(aName); + if(!gIsOBYUTF8 && !UniConv::IsPureASCIITextStream(iName)) + { + char* tempnname = strdup(iName); + unsigned int namelen = 0; + if(UniConv::DefaultCodePage2UTF8(tempnname, strlen(tempnname), &iName, &namelen) < 0) + Print(EError, "Invalid filename encoding: %s\n", tempnname); + free(tempnname); + } + } } // // Destructor