-----Original Message-----
From: Williamson, Siehnai [mailto:[EMAIL PROTECTED]]
Sent: Monday, May 14, 2001 3:20 PM
To: '[EMAIL PROTECTED]'
Subject: transcoding error while opening fileHi 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
Title: transcoding error while opening file
You need to escape
the backslashes in your string. The string you
entered:
"D:\projects\TranBack Siehnai
XML\xerces-c1_3_0-win32\bin\personal.xml"
Should
be:
"D:\\projects\\TranBack Siehnai
XML\\xerces-c1_3_0-win32\\bin\\personal.xml"
Ray
- transcoding error while opening file Williamson, Siehnai
- RE: transcoding error while opening file Mitchell, Raymond
- RE: transcoding error while opening file Dean Roddey
- RE: transcoding error while opening file Williamson, Siehnai
