Hi,
I am using log4cxx0.10.0 on windows XP, with Visual Studio 2005.
and the Configuration Properties are default as follows:
Configuration Type: Application(.exe)
Use of MFC: Use standard windows library
Use of ATL: Not using ATL
Minimize CRT use in ATL: No
Character set: Not set
Common Language Runtime support: No Common Language Runtime support
Whole Program Optimization: No Whole Program Optimization
and the Debugger type is Auto
Regards,
Madhu Gowda
--- On Mon, 5/12/08, Curt Arnold <[EMAIL PROTECTED]> wrote:
From: Curt Arnold <[EMAIL PROTECTED]> Subject: Re: LogString conversion To: "Log4CXX User" <log4cxx-user@logging.apache.org> Date: Monday, May 12, 2008, 5:29 PM
On May 12, 2008, at 9:15 AM, Madhu Gowda wrote:
> Hi,
>
> I tried the following in my sample program.
> std::string sLogFile = "TestLog.txt";
> LogString sFileName;
> log4cxx::helpers::Transcoder::decode( sLogFile, sFileName);
>
> But, it gives the sFileName as "".
>
> I tried to debug and saw that in the function
> void Transcoder::decode(const std::string& src, LogString& dst) {
>
> the value of src is coming as <Bad Ptr>
>
> Kindly advise on this.
>
> Regards,
> Madhu Gowda
The transcoding code is the most sensitive to platform differences.
The code path for transcoding on WIndows is very different from on
Linux, for example. To really be able to track down anything related
to transcoding, it is essential to know the platform, compiler and
build options.
Also, you are reporting something regarding a particular debugger's
display rendering of a particular STL libraries std::string class.
None of that is specific to log4cxx and is very specific to the
debugger and STL library in use. It may be that src is perfectly
usable, just that it is not being displayed the way you'd like.
Did you run the unit test suite? TimeBasedRollingTest fails
occasionally, but all the other tests should pass. If there is a
problem with encoding and decoding on your platform, it would likely
come up in the unit tests and it would be a lot easier to diagnose and
fix.
However, since you don't have any non-ASCII characters in your source
string, decoding should be as simple as copying character by character
into the destination. What happens when you single step through the
code? |