You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by David Braaten <da...@multiactive.com> on 2001/02/02 02:30:43 UTC

Re: Xalan C++ TranscodeFrom/To LocalCodePage (problem). (More info, again)

It seems that the line:
XalanDOMString theFileName = TranscodeFromLocalCodePage(c_str(outFileName));
is the one that produces the empty string in release mode.



----- Original Message -----
From: "David Braaten" <da...@multiactive.com>
To: <xa...@xml.apache.org>
Sent: Thursday, February 01, 2001 04:40 PM
Subject: Re: Xalan C++ TranscodeFrom/To LocalCodePage (problem). (More info)


>
> While the code below always seems to fail to produce a string,
> sometimes XalanFileOutputStream is successful in producing its
> filename.
> BUT, once the code below has been executed or XalanFileOutputStream
> has failed to produce a filename once, XalanFileOutputStream will never
> again be able to produce a filename other than an empty string.
>
> wierdness...
>
> ----- Original Message -----
> From: "David Braaten" <da...@multiactive.com>
> To: <xa...@xml.apache.org>
> Sent: Thursday, February 01, 2001 04:16 PM
> Subject: Xalan C++ TranscodeFrom/To LocalCodePage (problem).
>
>
> > In a release mode build on nt4sp5,vc6sp4(current cvs source),
> TranscodeFrom
> > or TranscodeTo is returning an empty string. Since XalanFileOutputStream
> is
> > using
> > TranscodeToLocalCodePage to get the filename it should use, this
> > is a slight problem...
> >
> > Of course, since it works fine in debug, it's probably some insane MS
bug,
> > but it would be nice if someone else could see if they get the same
> > behaviour.
> >
> > Here is a bit of code that will repro the problem. The third message box
> > will be
> > empty.
> > -----
> >
> >   CString strXMLFilename("c:\temp\temp.xml");
> >   CharVectorType outFileName;
> >
> >   CopyStringToVector((LPCTSTR)strXMLFilename, outFileName);
> >
> >   const char* const tmpName1 = &outFileName[0];
> >
> >   ::MessageBox( NULL, tmpName1, "1", MB_OK );
> >
> >   ::MessageBox( NULL, c_str(outFileName), "2", MB_OK );
> >
> >   XalanDOMString theFileName =
> > TranscodeFromLocalCodePage(c_str(outFileName));
> >
> >
> > // excerpted from XalanFileOutputStream:
> >
> >   const CharVectorType theResult(TranscodeToLocalCodePage(theFileName));
> >
> >   assert(theResult.size() > 0);
> >
> >   const char* const tmpName = &theResult[0];
> >
> >   ::MessageBox( NULL, tmpName, "3", MB_OK );
> >
> > -----
> >