Title: transcoding error while opening file
Time bo break out "How to Write C in 21 Days". If you use \ characters in a path in C/C++, that acts as an escape character. Either use \\ to escape the escape and get a single slash, or use / characters, which work just fine in NT (except to the command line processor for some reason.)

--------------
Dean Roddey
Software Geek Extraordinaire
Portal, Inc
[EMAIL PROTECTED]

-----Original Message-----
From: Williamson, Siehnai [mailto:[EMAIL PROTECTED]]
Sent: Monday, May 14, 2001 3:20 PM
To: '[EMAIL PROTECTED]'
Subject: transcoding error while opening file

Hi Guys,

I am using xerces-c1_3_0-win32, and when attempting to call LocalFileInputSource(const XMLCh* const filepath), I get an error right at the point where I attempt to open my xml file. 

I later discovered that the transcoder  in XMLPlatformUtils::openFile(fileName) returns gibberish rather than the file as a string.  The transcoder works if I send the file name as "personal.xml" without its path.  But once its path is included, then the transcoding doesn't work. 

This filepath I am using is "D:\projects\TranBack Siehnai XML\xerces-c1_3_0-win32\bin\personal.xml".


Here's the section in scanFirst() where my program bombs:

BinFileInputStream::BinFileInputStream(const XMLCh* const fileName) :

    fSource(0)
{
    // Try to open the file
    fSource = XMLPlatformUtils::openFile(fileName);
}


Within XMLPlatformUtils::openFile(fileName) here's the piece of code that returns gibberish:

char* tmpName = XMLString::transcode(nameToOpen);


resulting contents of tmpName:
-       tmpName 0x00c25270 "�������������������������������������"



Also, if I want to use my xml file's filepath as the base path with no relative path, do I call the specific LocalFileInputSource function by using 0 as the relative path parameter?:

E.g:
LocalFileInputSource(const XMLCh* const myFilePath, 0)



Thanks,


Siehnai Williamson

Reply via email to