Title: RE: transcoding error while opening file

Hi,

How silly of me to forget the escapes.  However, it still doesn't work.  It appears that the ::wcstombs(m_bLocalForm, tmpSource, targetLen) function within

the StrX tmp() function is failing and returns -1 because my file string goes over the 255 limit.  I am using LATIN1 encoding to test.  Should I use a different encoding?


    -----Original Message-----
    From:   Mitchell, Raymond [SMTP:[EMAIL PROTECTED]]
    Sent:   Monday, May 14, 2001 5:39 PM
    To:     '[EMAIL PROTECTED]'
    Subject:        RE: 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

      -----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